Constructor
# new SerializationError(msg) → {SerializationError}
Represents a failure in the Model de/serialization, typically when converting between data formats
Error thrown when serialization or deserialization fails
Parameters:
Name | Type | Description |
---|---|---|
msg |
string
|
Error
|
The error message or Error object |
A new SerializationError instance
Example
// Throw a serialization error when JSON parsing fails
try {
const data = JSON.parse(invalidJson);
} catch (error) {
throw new SerializationError('Failed to parse JSON data');
}