Converts the error entry into a JSON-compatible map.
Map<String, dynamic> toJson() => { 'message': message, 'timestamp': timestamp.toIso8601String(), };