1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: change IError msg and code to methods + fix vlib, add a deprecation notice for the old usages (#13041)

This commit is contained in:
Tim Basel
2022-02-11 14:52:33 +01:00
committed by GitHub
parent 61024d4b75
commit 9d0a5942ac
80 changed files with 493 additions and 324 deletions

View File

@@ -255,7 +255,7 @@ pub fn (mut ctx Context) json_pretty<T>(j T) Result {
pub fn (mut ctx Context) file(f_path string) Result {
ext := os.file_ext(f_path)
data := os.read_file(f_path) or {
eprint(err.msg)
eprint(err.msg())
ctx.server_error(500)
return Result{}
}
@@ -417,7 +417,7 @@ pub fn run_at<T>(global_app &T, host string, port int) {
request_app.Context = global_app.Context // copy the context ref that contains static files map etc
mut conn := l.accept() or {
// failures should not panic
eprintln('accept() failed with error: $err.msg')
eprintln('accept() failed with error: $err.msg()')
continue
}
go handle_conn<T>(mut conn, mut request_app, routes)