Return a map representation of this error suitable for conversion to json.
Map<String, dynamic> toMap() => <String, Object?>{ 'code': code, 'message': message, if (data != null) 'data': data, };