mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
fix(offline): /Generally/ a timeout is a temporary error code. Only SendDraftTask should bail and tell the user the draft failed to send
This commit is contained in:
parent
45fa6d0a8b
commit
525e1419e3
|
@ -20,8 +20,9 @@ class ComposerWithWindowProps extends React.Component
|
|||
componentDidMount: ->
|
||||
@unlisten = atom.onWindowPropsReceived (windowProps) =>
|
||||
{errorMessage} = windowProps
|
||||
@_showInitialErrorDialog(errorMessage) if errorMessage
|
||||
@setState(windowProps)
|
||||
if errorMessage
|
||||
@_showInitialErrorDialog(errorMessage)
|
||||
|
||||
componentWillUnmount: ->
|
||||
@unlisten()
|
||||
|
|
|
@ -10,7 +10,7 @@ async = require 'async'
|
|||
# A 0 code is when an error returns without a status code. These are
|
||||
# things like "ESOCKETTIMEDOUT"
|
||||
TimeoutErrorCode = 0
|
||||
PermanentErrorCodes = [400, 404, 500, TimeoutErrorCode]
|
||||
PermanentErrorCodes = [400, 404, 500]
|
||||
CancelledErrorCode = -123
|
||||
SampleTemporaryErrorCode = 504
|
||||
|
||||
|
|
|
@ -10,6 +10,12 @@ class ChangeStarredTask extends ChangeMailTask
|
|||
constructor: ({@starred}={}) ->
|
||||
super
|
||||
|
||||
label: ->
|
||||
if @starred
|
||||
"Starring…"
|
||||
else
|
||||
"Unstarring…"
|
||||
|
||||
description: ->
|
||||
count = @threads.length
|
||||
type = 'thread'
|
||||
|
|
|
@ -89,7 +89,8 @@ class SendDraftTask extends Task
|
|||
body.thread_id = null
|
||||
body.reply_to_message_id = null
|
||||
return @_send(body)
|
||||
else if err.statusCode in NylasAPI.PermanentErrorCodes
|
||||
else if (err.statusCode in NylasAPI.PermanentErrorCodes or
|
||||
err.statusCode is NylasAPI.TimeoutErrorCode)
|
||||
@_permanentError()
|
||||
else
|
||||
return Promise.resolve(Task.Status.Retry)
|
||||
|
|
Loading…
Reference in a new issue