Skip to content

Commit

Permalink
builtin: cleanup interface IError
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Aug 17, 2024
1 parent 8210593 commit 9dcb834
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions vlib/builtin/result.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ module builtin

// IError holds information about an error instance
pub interface IError {
// >> Hack to allow old style custom error implementations
// TODO: remove once deprecation period for `IError` methods has ended
msg string
code int // <<
msg() string
code() int
}
Expand Down Expand Up @@ -43,10 +39,6 @@ pub fn (err IError) str() string {
(*err).str()
}
else {
// >> Hack to allow old style custom error implementations
// TODO: remove once deprecation period for `IError` methods has ended
// old_error_style := unsafe { voidptr(&err.msg) != voidptr(&err.code) } // if fields are not defined (new style) they don't have an offset between
// <<
'${err.type_name()}: ${err.msg()}'
}
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/picohttpparser/request_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn test_handles_incomplete_requests() {
assert req.prev_len == 0

remaining_parsed := req.parse_request(' HTTP/1.1\r\n\r\n') or {
assert err.msg == 'error parsing request: invalid character "13"'
assert err.msg() == 'error parsing request: invalid character "13"'
0
}
assert remaining_parsed == 0
Expand Down

0 comments on commit 9dcb834

Please sign in to comment.