feat(t237): import freight orders synchronously
This commit is contained in:
@@ -852,6 +852,8 @@ func writeUsecaseError(ctx *gin.Context, err error) {
|
||||
status = http.StatusBadGateway
|
||||
case "OCR_SERVICE_INVALID", "ERP_UNAVAILABLE":
|
||||
status = http.StatusServiceUnavailable
|
||||
case "FREIGHT_SYNC_TIMEOUT":
|
||||
status = http.StatusGatewayTimeout
|
||||
}
|
||||
message := typed.Message
|
||||
if preflightMessage, ok := freightPreflightPublicMessage(typed.Code); ok {
|
||||
@@ -883,6 +885,10 @@ func freightPreflightPublicMessage(code string) (string, bool) {
|
||||
return "OCR service is invalid", true
|
||||
case "ERP_UNAVAILABLE":
|
||||
return "ERP is temporarily unavailable", true
|
||||
case "FREIGHT_SYNC_TIMEOUT":
|
||||
return "freight order sync exceeded 55 seconds", true
|
||||
case "FREIGHT_SYNC_BUSY":
|
||||
return "another freight order sync is already running", true
|
||||
default:
|
||||
return "", false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user