Skip to content

Commit 37142f5

Browse files
committed
fix error codes
1 parent af30a2d commit 37142f5

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

src/zaudio.zig

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ pub const Error = error{
8181
Cancelled,
8282
MemoryAlreadyMapped,
8383

84+
CrcNotMatch,
85+
8486
FormatNotSupported,
8587
DeviceTypeNotSupported,
8688
ShareModeNotSupported,
@@ -89,6 +91,7 @@ pub const Error = error{
8991
ApiNotFound,
9092
InvalidDeviceConfig,
9193
Loop,
94+
BackendNotEnabled,
9295

9396
DeviceNotInitialized,
9497
DeviceAlreadyInitialized,
@@ -156,24 +159,27 @@ pub const Result = enum(i32) {
156159
cancelled = -51,
157160
memory_already_mapped = -52,
158161

159-
format_not_supported = -100,
160-
device_type_not_supported = -101,
161-
share_mode_not_supported = -102,
162-
no_backend = -103,
163-
no_device = -104,
164-
api_not_found = -105,
165-
invalid_device_config = -106,
166-
loop = -107,
167-
168-
device_not_initialized = -200,
169-
device_already_initialized = -201,
170-
device_not_started = -202,
171-
device_not_stopped = -203,
172-
173-
failed_to_init_backend = -300,
174-
failed_to_open_backend_device = -301,
175-
failed_to_start_backend_device = -302,
176-
failed_to_stop_backend_device = -303,
162+
crc_not_match = -100,
163+
164+
format_not_supported = -200,
165+
device_type_not_supported = -201,
166+
share_mode_not_supported = -202,
167+
no_backend = -203,
168+
no_device = -204,
169+
api_not_found = -205,
170+
invalid_device_config = -206,
171+
loop = -207,
172+
backend_not_enabled = -208,
173+
174+
device_not_initialized = -300,
175+
device_already_initialized = -301,
176+
device_not_started = -302,
177+
device_not_stopped = -303,
178+
179+
failed_to_init_backend = -400,
180+
failed_to_open_backend_device = -401,
181+
failed_to_start_backend_device = -402,
182+
failed_to_stop_backend_device = -403,
177183
};
178184

179185
pub fn maybeError(result: Result) Error!void {
@@ -232,6 +238,8 @@ pub fn maybeError(result: Result) Error!void {
232238
.cancelled => error.Cancelled,
233239
.memory_already_mapped => error.MemoryAlreadyMapped,
234240

241+
.crc_not_match => error.CrcNotMatch,
242+
235243
.format_not_supported => error.FormatNotSupported,
236244
.device_type_not_supported => error.DeviceTypeNotSupported,
237245
.share_mode_not_supported => error.ShareModeNotSupported,
@@ -240,6 +248,7 @@ pub fn maybeError(result: Result) Error!void {
240248
.api_not_found => error.ApiNotFound,
241249
.invalid_device_config => error.InvalidDeviceConfig,
242250
.loop => error.Loop,
251+
.backend_not_enabled => error.BackendNotEnabled,
243252

244253
.device_not_initialized => error.DeviceNotInitialized,
245254
.device_already_initialized => error.DeviceAlreadyInitialized,

0 commit comments

Comments
 (0)