Skip to content

Instantly share code, notes, and snippets.

@benmkramer
Created February 13, 2014 21:44
Show Gist options
  • Save benmkramer/8984518 to your computer and use it in GitHub Desktop.
Save benmkramer/8984518 to your computer and use it in GitHub Desktop.
try {
var data = JSON.parse(b);
} catch (e) {}
if (data.type === 'SOMEERROR') {
res.cookie(...)
return res.redirect(...)
}
return next('api:error...')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment