mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-27 10:33:56 +08:00
fix(error-handling): RFC822 endpoint not passing correct params
This commit is contained in:
parent
1d464453d8
commit
8cbf12b271
2 changed files with 3 additions and 4 deletions
|
@ -196,7 +196,7 @@ class MessageItem extends React.Component
|
|||
headers:
|
||||
Accept: 'message/rfc822'
|
||||
path: "/n/#{@props.message.namespaceId}/messages/#{@props.message.id}"
|
||||
json:null
|
||||
json:false
|
||||
success: (body) =>
|
||||
fs.writeFile tmpfile, body, =>
|
||||
window = new BrowserWindow(width: 800, height: 600, title: "#{@props.message.subject} - RFC822")
|
||||
|
|
|
@ -126,15 +126,14 @@ class NylasAPI
|
|||
@_handleModel404(options.url)
|
||||
if response.statusCode is 401
|
||||
@_handle401(options.url)
|
||||
if options.error
|
||||
options.error(new APIError({error, response, body}))
|
||||
options.error?(new APIError({error, response, body}))
|
||||
else
|
||||
if options.json
|
||||
if _.isString(body)
|
||||
try
|
||||
body = JSON.parse(body)
|
||||
catch error
|
||||
options.error(new APIError({error, response, body}))
|
||||
options.error?(new APIError({error, response, body}))
|
||||
if options.returnsModel
|
||||
@_handleModelResponse(body)
|
||||
|
||||
|
|
Loading…
Reference in a new issue