Skip to content

Commit

Permalink
editoast: refactor core error
Browse files Browse the repository at this point in the history
Signed-off-by: hamz2a <[email protected]>
  • Loading branch information
hamz2a committed Mar 6, 2025
1 parent 164c697 commit 2dfb381
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 255 deletions.
156 changes: 0 additions & 156 deletions editoast/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4749,155 +4749,6 @@ components:
type: string
enum:
- editoast:cache_operation:ObjectNotFound
EditoastCoreErrorBrokenPipe:
type: object
required:
- type
- status
- message
properties:
context:
type: object
message:
type: string
status:
type: integer
enum:
- 500
type:
type: string
enum:
- editoast:coreclient:BrokenPipe
EditoastCoreErrorConnectionClosedBeforeMessageCompleted:
type: object
required:
- type
- status
- message
properties:
context:
type: object
message:
type: string
status:
type: integer
enum:
- 500
type:
type: string
enum:
- editoast:coreclient:ConnectionClosedBeforeMessageCompleted
EditoastCoreErrorConnectionResetByPeer:
type: object
required:
- type
- status
- message
properties:
context:
type: object
message:
type: string
status:
type: integer
enum:
- 500
type:
type: string
enum:
- editoast:coreclient:ConnectionResetByPeer
EditoastCoreErrorCoreResponseFormatError:
type: object
required:
- type
- status
- message
properties:
context:
type: object
required:
- msg
properties:
msg:
type: string
message:
type: string
status:
type: integer
enum:
- 500
type:
type: string
enum:
- editoast:coreclient:CoreResponseFormatError
EditoastCoreErrorGenericCoreError:
type: object
required:
- type
- status
- message
properties:
context:
type: object
required:
- raw_error
- status
- url
properties:
raw_error:
type: string
status:
type: object
url:
type: string
message:
type: string
status:
type: integer
enum:
- 400
type:
type: string
enum:
- editoast:coreclient:GenericCoreError
EditoastCoreErrorMqClientError:
type: object
required:
- type
- status
- message
properties:
context:
type: object
message:
type: string
status:
type: integer
enum:
- 500
type:
type: string
enum:
- editoast:coreclient:MqClientError
EditoastCoreErrorUnparsableErrorOutput:
type: object
required:
- type
- status
- message
properties:
context:
type: object
message:
type: string
status:
type: integer
enum:
- 400
type:
type: string
enum:
- editoast:coreclient:UnparsableErrorOutput
EditoastDatabaseAccessErrorDatabaseAccessError:
type: object
required:
Expand Down Expand Up @@ -5106,13 +4957,6 @@ components:
- $ref: '#/components/schemas/EditoastAutoFixesEditoastErrorMissingErrorObject'
- $ref: '#/components/schemas/EditoastCacheOperationErrorDuplicateIdsProvided'
- $ref: '#/components/schemas/EditoastCacheOperationErrorObjectNotFound'
- $ref: '#/components/schemas/EditoastCoreErrorBrokenPipe'
- $ref: '#/components/schemas/EditoastCoreErrorConnectionClosedBeforeMessageCompleted'
- $ref: '#/components/schemas/EditoastCoreErrorConnectionResetByPeer'
- $ref: '#/components/schemas/EditoastCoreErrorCoreResponseFormatError'
- $ref: '#/components/schemas/EditoastCoreErrorGenericCoreError'
- $ref: '#/components/schemas/EditoastCoreErrorMqClientError'
- $ref: '#/components/schemas/EditoastCoreErrorUnparsableErrorOutput'
- $ref: '#/components/schemas/EditoastDatabaseAccessErrorDatabaseAccessError'
- $ref: '#/components/schemas/EditoastDelimitedAreaErrorInvalidLocations'
- $ref: '#/components/schemas/EditoastDocumentErrorsDatabase'
Expand Down
4 changes: 1 addition & 3 deletions editoast/src/core/mocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ impl From<MockingClient> for CoreClient {
#[derive(Debug)]
pub struct MockingError {
pub bytes: Vec<u8>,
pub status: StatusCode,
pub url: String,
}

Expand Down Expand Up @@ -96,13 +95,12 @@ impl MockingClient {
)
.expect("mocked response body should deserialize faultlessly"),
)),
Some(StubResponse { code, .. }) => {
Some(StubResponse { .. }) => {
let err = response
.expect("mocked response body should not be empty when specified")
.to_vec();
Err(MockingError {
bytes: err,
status: code,
url: req_path,
})
}
Expand Down
Loading

0 comments on commit 2dfb381

Please sign in to comment.