Removed deprecated err.msg & err.code

This commit is contained in:
Jef Roosens 2022-04-13 22:20:05 +02:00
parent f7e1aba30b
commit 78b477fb92
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
8 changed files with 18 additions and 20 deletions

View file

@ -249,7 +249,7 @@ 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{}
// }
@ -267,7 +267,7 @@ pub fn (mut ctx Context) file(f_path string) Result {
file_size := os.file_size(f_path)
file := os.open(f_path) or {
eprintln(err.msg)
eprintln(err.msg())
ctx.server_error(500)
return Result{}
}
@ -361,7 +361,7 @@ interface DbInterface {
// run runs the app
[manualfree]
pub fn run<T>(global_app &T, port int) {
mut l := net.listen_tcp(.ip6, ':$port') or { panic('failed to listen $err.code $err') }
mut l := net.listen_tcp(.ip6, ':$port') or { panic('failed to listen $err.code() $err') }
// Parsing methods attributes
mut routes := map[string]Route{}
@ -393,7 +393,7 @@ pub fn run<T>(global_app &T, 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)