javascript: parse the upload status code correctly
Previously the status was "Status: 422" instead of just 422.
This commit is contained in:
parent
ef5e5977fc
commit
b006c33ebe
1 changed files with 2 additions and 2 deletions
|
@ -51,8 +51,8 @@ export default class FileUploadError extends Error {
|
|||
// (so that Sentry knows they are different kind of errors, from
|
||||
// the line they were created.)
|
||||
export function errorFromDirectUploadMessage(message) {
|
||||
let matches = message.match(/ Status: [0-9]{1,3}/);
|
||||
let status = (matches && parseInt(matches[0], 10)) || undefined;
|
||||
let matches = message.match(/ Status: ([0-9]{1,3})/);
|
||||
let status = matches ? parseInt(matches[1], 10) : undefined;
|
||||
|
||||
// prettier-ignore
|
||||
if (message.includes('Error reading')) {
|
||||
|
|
Loading…
Reference in a new issue