diff --git a/api/openapi.yaml b/api/openapi.yaml index 8233788..ae50452 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1108,12 +1108,16 @@ paths: $ref: "#/components/schemas/ApplicationError" example: {type: "VALIDATION_ERROR", message: "Invalid request data."} "404": - description: Channel not found + description: Channel or wallet not found content: application/json: schema: $ref: "#/components/schemas/ApplicationError" - example: {type: "NOT_FOUND", message: "The requested channel was not found."} + examples: + channelNotFound: + value: {type: "NOT_FOUND", code: "CHANNEL_NOT_FOUND", message: "channel with ID abc not found"} + walletNotFound: + value: {type: "NOT_FOUND", code: "WALLET_NOT_FOUND", message: "wallet with address 0x742d35Cc6634C0532925a3b844Bc454e4438f44e and chain_selector 16015286601757825753 not found"} "500": description: Internal server error content: @@ -2151,6 +2155,22 @@ components: - to - value - data + ApplicationErrorCode: + type: string + description: Machine-readable error code for NOT_FOUND responses. + enum: + - CHANNEL_NOT_FOUND + - WALLET_NOT_FOUND + - OPERATION_NOT_FOUND + - WATCHER_NOT_FOUND + - QUERY_NOT_FOUND + x-enum-varnames: + - ApplicationErrorCodeChannelNotFound + - ApplicationErrorCodeWalletNotFound + - ApplicationErrorCodeOperationNotFound + - ApplicationErrorCodeWatcherNotFound + - ApplicationErrorCodeQueryNotFound + example: "WALLET_NOT_FOUND" ApplicationError: description: Standard error response body. type: object @@ -2165,6 +2185,8 @@ components: - "CONFLICT" - "INTERNAL_ERROR" - "ORGANIZATION_NOT_FOUND" + code: + $ref: "#/components/schemas/ApplicationErrorCode" message: type: string description: Error message describing the issue diff --git a/client/client.gen.go b/client/client.gen.go index 98ae384..5cfd82c 100644 --- a/client/client.gen.go +++ b/client/client.gen.go @@ -31,6 +31,15 @@ const ( VALIDATIONERROR ApplicationErrorType = "VALIDATION_ERROR" ) +// Defines values for ApplicationErrorCode. +const ( + ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" + ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" + ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" + ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" + ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" +) + // Defines values for BlockNumberBlockSelectionType. const ( BlockNumberBlockSelectionTypeBlockNumber BlockNumberBlockSelectionType = "block_number" @@ -144,6 +153,9 @@ const ( // ApplicationError Standard error response body. type ApplicationError struct { + // Code Machine-readable error code for NOT_FOUND responses. + Code *ApplicationErrorCode `json:"code,omitempty"` + // Message Error message describing the issue Message string `json:"message"` @@ -154,6 +166,9 @@ type ApplicationError struct { // ApplicationErrorType Error type type ApplicationErrorType string +// ApplicationErrorCode Machine-readable error code for NOT_FOUND responses. +type ApplicationErrorCode string + // BlockNumberBlockSelection defines model for BlockNumberBlockSelection. type BlockNumberBlockSelection struct { // BlockNumber Decimal uint64 block number. diff --git a/ginserver/ginserver.gen.go b/ginserver/ginserver.gen.go index 18b7493..3a0b9e8 100644 --- a/ginserver/ginserver.gen.go +++ b/ginserver/ginserver.gen.go @@ -29,6 +29,15 @@ const ( VALIDATIONERROR ApplicationErrorType = "VALIDATION_ERROR" ) +// Defines values for ApplicationErrorCode. +const ( + ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" + ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" + ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" + ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" + ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" +) + // Defines values for BlockNumberBlockSelectionType. const ( BlockNumberBlockSelectionTypeBlockNumber BlockNumberBlockSelectionType = "block_number" @@ -142,6 +151,9 @@ const ( // ApplicationError Standard error response body. type ApplicationError struct { + // Code Machine-readable error code for NOT_FOUND responses. + Code *ApplicationErrorCode `json:"code,omitempty"` + // Message Error message describing the issue Message string `json:"message"` @@ -152,6 +164,9 @@ type ApplicationError struct { // ApplicationErrorType Error type type ApplicationErrorType string +// ApplicationErrorCode Machine-readable error code for NOT_FOUND responses. +type ApplicationErrorCode string + // BlockNumberBlockSelection defines model for BlockNumberBlockSelection. type BlockNumberBlockSelection struct { // BlockNumber Decimal uint64 block number. diff --git a/stdserver/stdserver.gen.go b/stdserver/stdserver.gen.go index 1598057..7ee1bd5 100644 --- a/stdserver/stdserver.gen.go +++ b/stdserver/stdserver.gen.go @@ -29,6 +29,15 @@ const ( VALIDATIONERROR ApplicationErrorType = "VALIDATION_ERROR" ) +// Defines values for ApplicationErrorCode. +const ( + ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" + ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" + ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" + ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" + ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" +) + // Defines values for BlockNumberBlockSelectionType. const ( BlockNumberBlockSelectionTypeBlockNumber BlockNumberBlockSelectionType = "block_number" @@ -142,6 +151,9 @@ const ( // ApplicationError Standard error response body. type ApplicationError struct { + // Code Machine-readable error code for NOT_FOUND responses. + Code *ApplicationErrorCode `json:"code,omitempty"` + // Message Error message describing the issue Message string `json:"message"` @@ -152,6 +164,9 @@ type ApplicationError struct { // ApplicationErrorType Error type type ApplicationErrorType string +// ApplicationErrorCode Machine-readable error code for NOT_FOUND responses. +type ApplicationErrorCode string + // BlockNumberBlockSelection defines model for BlockNumberBlockSelection. type BlockNumberBlockSelection struct { // BlockNumber Decimal uint64 block number.