From c843002d07bb7d42b4c1e29801489ee7eb75edf9 Mon Sep 17 00:00:00 2001 From: flysand7 Date: Mon, 25 Mar 2024 23:35:01 +1100 Subject: [PATCH] [core/os2]: Move .Broken_Pipe to General_Error enum --- core/os/os2/errors.odin | 14 +++----------- 1 file 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)) }