Skip to content

Commit

Permalink
Do not treat Celest types specially
Browse files Browse the repository at this point in the history
  • Loading branch information
dnys1 committed Feb 20, 2024
1 parent 9dc8a1a commit 30bcbe6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 60 deletions.
12 changes: 0 additions & 12 deletions packages/celest/lib/src/runtime/serve.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,6 @@ Handler _cloudExceptionMiddleware(Handler inner) {
return (request) async {
try {
return await inner(request);
} on BadRequestException catch (e) {
print('Bad request: ${e.message}');
return _badRequest(
code: 'BadRequestException',
details: Serializers.instance.serialize(e),
);
} on InternalServerException catch (e) {
print('Internal server error: ${e.message}');
return _internalServerError(
code: 'InternalServerException',
details: Serializers.instance.serialize(e),
);
} on Exception catch (e, st) {
print('An unexpected error occurred: $e');
print(st);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ final class SerializationException extends FormatException
/// {@macro celest_core_exceptions_serialization_exception}
const SerializationException(super.message);

@override
// TODO(dnys1): Find a better resolution to this.
// ignore: overridden_fields
final Null source = null;

@override
String toString() => 'SerializationException: $message';
}
3 changes: 0 additions & 3 deletions packages/celest_core/lib/src/serialization/serializer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:typed_data';

import 'package:celest_core/celest_core.dart';
import 'package:celest_core/src/serialization/serializers/big_int_serializer.dart';
import 'package:celest_core/src/serialization/serializers/cloud_exception_serializer.dart';
import 'package:celest_core/src/serialization/serializers/date_time_serializer.dart';
import 'package:celest_core/src/serialization/serializers/duration_serializer.dart';
import 'package:celest_core/src/serialization/serializers/regexp_serializer.dart';
Expand Down Expand Up @@ -101,8 +100,6 @@ final class _Serializers extends Serializers {
put<Uri>(const UriSerializer());
put<UriData>(const UriDataSerializer());
put<Uint8List>(const Uint8ListSerializer());
put<BadRequestException>(const BadRequestExceptionSerializer());
put<InternalServerException>(const InternalServerExceptionSerializer());
}

final _serializersByType = <TypeToken<Object?>, Serializer>{};
Expand Down

This file was deleted.

0 comments on commit 30bcbe6

Please sign in to comment.