You've already forked agentic-coding-workflow
feat(jobs): migration 0005 + errs codes for jobs module
This commit is contained in:
@@ -66,6 +66,13 @@ const (
|
||||
// Storage 域
|
||||
CodeStoragePutFailed Code = "storage.put_failed"
|
||||
CodeStorageGetFailed Code = "storage.get_failed"
|
||||
|
||||
// Jobs 域
|
||||
CodeJobNotFound Code = "job.not_found"
|
||||
CodeJobInvalidType Code = "job.invalid_type"
|
||||
CodeJobPayloadInvalid Code = "job.payload_invalid"
|
||||
CodeJobPayloadTooLarge Code = "job.payload_too_large"
|
||||
CodeWebhookNotConfigured Code = "webhook.not_configured"
|
||||
)
|
||||
|
||||
// AppError is the application's structured error type. It carries a stable
|
||||
@@ -171,6 +178,12 @@ func HTTPStatus(code Code) int {
|
||||
return http.StatusBadGateway
|
||||
case CodeLLMContextTooLong:
|
||||
return http.StatusBadRequest
|
||||
case CodeJobNotFound:
|
||||
return http.StatusNotFound
|
||||
case CodeJobInvalidType, CodeJobPayloadInvalid, CodeJobPayloadTooLarge:
|
||||
return http.StatusBadRequest
|
||||
case CodeWebhookNotConfigured:
|
||||
return http.StatusServiceUnavailable
|
||||
default:
|
||||
return http.StatusInternalServerError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user