Skip to content

Commit

Permalink
chore(core): Make SerializationException implement `BadRequestExcep…
Browse files Browse the repository at this point in the history
…tion`

When thrown on the server, a serialization exception means that the server received bad data from the client.
  • Loading branch information
dnys1 committed Feb 8, 2024
1 parent b927990 commit 8cf5bc8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/celest_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 0.2.0-dev

- Make `SerializationException` implement `BadRequestException`

## 0.1.1

- Update README
Expand Down
4 changes: 2 additions & 2 deletions packages/celest_core/lib/src/exception/cloud_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sealed class CloudException implements CelestException {}
/// An exception thrown by a Cloud Function when a request contains invalid
/// data or otherwise lead to a recoverable exception.
/// {@endtemplate}
final class BadRequestException implements CloudException {
class BadRequestException implements CloudException {
/// Creates a [BadRequestException] with the given [message].
///
/// {@macro celest_core_exception_bad_request_exception}
Expand All @@ -21,7 +21,7 @@ final class BadRequestException implements CloudException {
/// An exception thrown by a Cloud Function when an unrecoverable internal error
/// occurs.
/// {@endtemplate}
final class InternalServerException implements CloudException {
class InternalServerException implements CloudException {
/// Creates a [InternalServerException] with the given [message].
///
/// {@macro celest_core_exception_internal_server_exception}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:celest_core/celest_core.dart';
/// deserialize a value.
/// {@endtemplate}
final class SerializationException extends FormatException
implements CelestException {
implements BadRequestException, CelestException {
/// Creates a [SerializationException] with the given [message].
///
/// {@macro celest_core_exceptions_serialization_exception}
Expand Down

0 comments on commit 8cf5bc8

Please sign in to comment.