fix(error-handling): RFC822 endpoint not passing correct params

This commit is contained in:
Ben Gotow 2015-06-17 14:39:50 -07:00
parent 1d464453d8
commit 8cbf12b271
2 changed files with 3 additions and 4 deletions

View file

@ -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")

View file

@ -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)