Try to map to General_Error where possible
This commit is contained in:
1 parent
28666414bc
commit
def2e2e271
8 files changed
+103
-7
No files matched your search
+12
-1
@@ -521,7 +521,18 @@ _get_errno :: proc(res: int) -> Errno {
|
||||
|
||||
// get errno from libc
|
||||
get_last_error :: proc "contextless" () -> Error {
|
||||
return Platform_Error(__errno_location()^)
|
||||
err := Platform_Error(__errno_location()^)
|
||||
#partial switch err {
|
||||
case .NONE:
|
||||
return nil
|
||||
case .EPERM:
|
||||
return .Permission_Denied
|
||||
case .EEXIST:
|
||||
return .Exist
|
||||
case .ENOENT:
|
||||
return .Not_Exist
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
personality :: proc(persona: u64) -> (Errno) {
|
||||
|
||||
Reference in new issue
Block a user