-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
161 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
import '../dtos/city_dto.dart'; | ||
import '../error_handlers/not_found_exception.dart'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/dartness_server/lib/src/exception/http_client_error_exception.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import 'package:dartness_server/exception.dart'; | ||
|
||
/// Custom exception class representing HTTP client errors. | ||
/// | ||
/// This class extends [HttpStatusCodeException] and is used to indicate errors | ||
/// that occur on the client side of an HTTP request. It includes a human-readable | ||
/// [message] describing the error and an associated HTTP [statusCode]. | ||
class HttpClientErrorException extends HttpStatusCodeException { | ||
/// Creates an instance of [HttpClientErrorException] with the specified [message] | ||
/// and HTTP [statusCode]. | ||
const HttpClientErrorException(super.message, super.statusCode); | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/dartness_server/lib/src/exception/http_server_error_exception.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
import 'package:dartness_server/exception.dart'; | ||
|
||
/// A custom exception representing a generic HTTP server error. | ||
/// | ||
/// This exception extends [HttpStatusCodeException] and is used to signal | ||
/// errors that occur on the server side. It includes a human-readable [message] | ||
/// and an associated HTTP [statusCode] indicating the nature of the server error. | ||
class HttpServerErrorException extends HttpStatusCodeException { | ||
/// Creates an [HttpServerErrorException] with the specified [message] and [statusCode]. | ||
/// | ||
/// The [message] is a human-readable description of the server error, and | ||
/// [statusCode] represents the HTTP status code associated with the error. | ||
const HttpServerErrorException(super.message, super.statusCode); | ||
} |
19 changes: 8 additions & 11 deletions
19
packages/dartness_server/lib/src/exception/http_status_code_exception.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
/// Exception for HTTP status code. | ||
/// This abstract class is used to create custom exceptions for HTTP status codes. | ||
/// An abstract base class for custom exceptions representing HTTP status code errors. | ||
/// | ||
/// | ||
/// Example: | ||
/// ```dart | ||
/// class NotFoundException extends HttpStatusCodeException { | ||
/// const NotFoundException(String message) : super(message, HttpStatus.notFound); | ||
/// } | ||
/// ``` | ||
/// This class extends [Exception] and serves as a foundation for creating specific | ||
/// exceptions related to HTTP status codes. It includes a human-readable [message] | ||
/// describing the error and an associated HTTP [statusCode]. | ||
abstract class HttpStatusCodeException implements Exception { | ||
/// Creates an instance of [HttpStatusCodeException] with the specified [message] | ||
/// and HTTP [statusCode]. | ||
const HttpStatusCodeException(this.message, this.statusCode); | ||
|
||
/// The message of the exception. | ||
/// A human-readable description of the exception. | ||
final String message; | ||
|
||
/// The http status code of the exception. | ||
/// The HTTP status code associated with the exception. | ||
final int statusCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters