aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflysand7 <thebumboni@gmail.com>2024-03-25 23:35:01 +1100
committerflysand7 <thebumboni@gmail.com>2024-03-25 23:35:01 +1100
commitc843002d07bb7d42b4c1e29801489ee7eb75edf9 (patch)
tree4fdfb23711c977ff52f85495ec8a478417cbb7ef
parent0f944bc0a15f75594c3cec65572356868901394a (diff)
[core/os2]: Move .Broken_Pipe to General_Error enum
-rw-r--r--core/os/os2/errors.odin14
1 files changed, 3 insertions, 11 deletions
diff --git a/core/os/os2/errors.odin b/core/os/os2/errors.odin
index 77c5b1199..d76b2d549 100644
--- a/core/os/os2/errors.odin
+++ b/core/os/os2/errors.odin
@@ -13,6 +13,8 @@ General_Error :: enum u32 {
Timeout,
+ Broken_Pipe,
+
// Indicates that an attempt to retrieve a file's size was made, but the
// file doesn't have a size.
No_Size,
@@ -26,15 +28,9 @@ General_Error :: enum u32 {
Platform_Error :: enum i32 {None=0}
-Read_Error :: enum u32 {
- None,
- Broken_Pipe,
-}
-
Error :: union #shared_nil {
General_Error,
io.Error,
- Read_Error,
runtime.Allocator_Error,
Platform_Error,
}
@@ -61,6 +57,7 @@ error_string :: proc(ferr: Error) -> string {
case .Not_Exist: return "file does not exist"
case .Closed: return "file already closed"
case .Timeout: return "i/o timeout"
+ case .Broken_Pipe: return "Broken pipe"
case .No_Size: return "file has no definite size"
case .Invalid_File: return "invalid file"
case .Invalid_Dir: return "invalid directory"
@@ -93,11 +90,6 @@ error_string :: proc(ferr: Error) -> string {
case .Invalid_Argument: return "invalid allocator argument"
case .Mode_Not_Implemented: return "allocator mode not implemented"
}
- case Read_Error:
- switch e {
- case .None: return ""
- case .Broken_Pipe: return "Broken pipe"
- }
case Platform_Error:
return _error_string(i32(e))
}