mirror of
https://github.com/vlang/v.git
synced 2025-09-08 14:51:53 -04:00
builtin: cleanup interface IError, remove the obsolete .code and .msg fields, deprecated in 2022-02-11 (#22063)
This commit is contained in:
parent
8210593349
commit
ee16f6f094
@ -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
|
||||
}
|
||||
@ -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()}'
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user