MikrotikException
Root exception type for the osisa.Mikrotik client. Carries the original HTTP status + parsed MikroTik REST error body fields (error, message, detail) so callers can branch on status (404 vs 401 vs 400) and surface readable messages.
public class MikrotikException : Exception, ISerializable
1. Constructors
1.1. MikrotikException(int, string, string)
Initializes a new MikrotikException.
public MikrotikException(int statusCode, string errorMessage, string detail = null)
| Name | Type | Description |
|---|---|---|
statusCode |
int |
|
errorMessage |
string |
|
detail |
string |
1.2. MikrotikException(int, string, string, Exception)
Initializes a new MikrotikException with an inner exception.
public MikrotikException(int statusCode, string errorMessage, string detail, Exception inner)
| Name | Type | Description |
|---|---|---|
statusCode |
int |
|
errorMessage |
string |
|
detail |
string |
|
inner |
Exception |
2. Properties
2.1. Detail
Parsed detail field from the MikroTik error JSON. Optional.
public string Detail { get; }
2.2. ErrorMessage
Parsed message field from the MikroTik error JSON.
public string ErrorMessage { get; }
2.3. StatusCode
HTTP status code returned by the device (or 0 for transport/parse failures).
public int StatusCode { get; }