Use this file to discover all available pages before exploring further.
Terbin defines multiple complementary error-code enums, each targeting a different layer of the stack. TerbinErrorCode is the low-level protocol enum serialised over the wire as a ushort. AppError covers higher-level business-logic failures as a long. ErrorFlags and ExceptionFlags are bitflag enums that let you combine multiple simultaneous error conditions into a single value for rich diagnostics. Together they provide a fully typed, code-based error system without relying on string parsing or exception message inspection.
TerbinErrorCode is the primary low-level error code type. It costs only 2 bytes on the wire. A value of 0 (None) always means success; every other value indicates a failure in one of the categories below.
public enum TerbinErrorCode : ushort{ None = 0, // All good (Success) ...}
AppError targets higher-level, human-readable business-logic errors. It is a long, making it suitable for in-process error propagation without the two-byte wire constraint of TerbinErrorCode. None = 0 means success.
ErrorFlags enum (ulong) and ExceptionFlags enum (ulong)
Both ErrorFlags and ExceptionFlags are [Flags] bitflag enums backed by ulong (64 bits), allowing any combination of error conditions to be expressed as a single value. They are intended as a rich diagnostic and future-extension mechanism.
ErrorFlags and ExceptionFlags are provided as a design reference and future extension mechanism. They are not yet heavily used in the current Terbin codebase, but you can use them today for rich in-process error aggregation or logging.
ErrorFlags — all bit values
ErrorFlags organises its 64 bits into eight categories. You can OR multiple flags together to express combined failure conditions.
[Flags]public enum ErrorFlags : ulong { ... }
Validation (bits 0–6)
Bit
Name
Description
0
NullParameter
A required parameter was null.
1
EmptyString
A required string was empty.
2
FormatInvalid
Value format is wrong.
3
ValueOutOfRange
Value is outside the permitted range.
4
InvalidLength
Length field is invalid.
5
MissingRequiredData
Required data was absent.
6
InvalidCast
A type cast failed.
Protocol & Packets (bits 8–14)
Bit
Name
Description
8
PacketMalformed
Packet structure is corrupt.
9
HeaderInvalid
Header contains invalid values.
10
PayloadTooLarge
Payload exceeds MAX_PLD.
11
FragmentationError
Fragment reassembly failed.
12
OrderMismatch
Unexpected packet sequence order.
13
ChecksumMismatch
Checksum does not match.
14
UnknownProtocolType
Unrecognised protocol type byte.
Memory & Streams (bits 16–22)
Bit
Name
Description
16
MemoryNotAllocated
Memory slot was never allocated.
17
MemoryIdNotFound
Release() or TryGetResult() failed to find the slot.
18
BufferOverflow
Write would overflow the buffer.
19
StreamReadError
Read from stream failed.
20
StreamWriteError
Write to stream failed.
21
EndOfStreamReached
Unexpected end of stream.
22
MemoryCorrupted
Memory contents are corrupt.
Execution & Dispatching (bits 24–28)
Bit
Name
Description
24
ActionNotFound
No handler registered for action key.
25
HandlerNotSet
Handler delegate is null.
26
MethodMismatch
Handler method signature doesn’t match.
27
ExecutionFault
Generic catch in DispatchAsync triggered.
28
ActionAlreadyExists
Duplicate action registration attempted.
State & Business Logic (bits 32–38)
Bit
Name
Description
32
NotFound
Resource not found.
33
AlreadyExists
Resource already exists.
34
InvalidState
Invalid state transition.
35
LimitExceeded
Quota or business limit exceeded.
36
DuplicateRequest
Duplicate in-flight request.
37
NotImplementedYet
Feature not yet implemented.
38
OperationRejected
Operation explicitly rejected.
Security (bits 42–45)
Bit
Name
Description
42
Unauthorized
Not authenticated.
43
Forbidden
Authenticated but not permitted.
44
TokenExpired
Authentication token has expired.
45
SignatureInvalid
Cryptographic signature is invalid.
Connectivity & Concurrency (bits 48–53)
Bit
Name
Description
48
Timeout
Exceeded MAXIMUS_RESPONSE_TIME.
49
ResourceLocked
File or memory is locked by another thread.
50
NetworkUnavailable
Network is not available.
51
ConnectionLost
Connection dropped unexpectedly.
52
UserCancelled
User explicitly cancelled the operation.
53
RateLimited
Request was rate-limited.
Critical Infrastructure (bits 56–63)
Bit
Name
Description
56
InternalSystemError
Unrecoverable system error.
57
DiskWriteFailed
Write to disk failed.
58
DataCorrupted
Stored data is corrupt.
63
FatalError
Highest-bit fatal sentinel — unrecoverable.
ExceptionFlags — all bit values
ExceptionFlags mirrors the .NET exception type hierarchy as bit flags. Each bit represents a specific exception class, allowing exception sets to be captured and compared without holding live exception objects.