mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: implement error_with_code(s string, code int)
Make available the integer code as errcode to callers/unwrappers
This commit is contained in:

committed by
Alexander Medvednikov

parent
9c5a359de3
commit
8364130a1f
@ -7,6 +7,7 @@ module builtin
|
||||
struct Option {
|
||||
data [255]byte
|
||||
error string
|
||||
ecode int
|
||||
ok bool
|
||||
is_none bool
|
||||
}
|
||||
@ -34,4 +35,12 @@ pub fn error(s string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn error_with_code(s string, code int) Option {
|
||||
return Option {
|
||||
error: s
|
||||
ecode: code
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user