You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the BackendGateway will always return FailBackendTransaction (554) if there is an error in one of the backend processors.
It would be useful if the error specified from the processor would be parsed and returned if valid...similar to this:
// wait for the save to complete
// or timeout
select {
case status := <-workerMsg.notifyMe:
defer workerMsgPool.Put(workerMsg) // can be recycled since we used the notifyMe channel
if status.err != nil {
if _, err := strconv.Atoi(status.err.Error()[:3]); err != nil {
return NewResult(response.Canned.FailBackendTransaction + status.err.Error())
}
return NewResult(status.err.Error())
}
return NewResult(response.Canned.SuccessMessageQueued + status.queuedID)
case <-time.After(gw.saveTimeout()):
Log().Error("Backend has timed out while saving eamil")
return NewResult(response.Canned.FailBackendTimeout)
}
in this way the backend could respond 421 (for example) and allow the client to retry to send the email.
Another solution could be to add the backend result in the notifyMsg (or a pointer to it)
The text was updated successfully, but these errors were encountered:
Would need to have a think about it. It seems like backend.Result and error could be married together. This is because there is only one result that is OK, all other result types are errors. So in other words, backend.Result could implement the error interface, and also have the ability to return the error as a response.
the BackendGateway will always return FailBackendTransaction (554) if there is an error in one of the backend processors.
It would be useful if the error specified from the processor would be parsed and returned if valid...similar to this:
in this way the backend could respond 421 (for example) and allow the client to retry to send the email.
Another solution could be to add the backend result in the
notifyMsg
(or a pointer to it)The text was updated successfully, but these errors were encountered: