Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the handling of user errors #1958

Merged
merged 6 commits into from Mar 13, 2019
Prev

Revert "fix unexpected "File size limit exceeded""

This reverts commit d838d82.
  • Loading branch information...
juliangruber committed Mar 13, 2019
commit 86a927d936705939463e210ff52b51347855b304
Copy path View file
@@ -32,8 +32,7 @@ import {
DomainVerificationFailed,
TooManyCertificates,
TooManyRequests,
InvalidDomain,
FileSizeLimitExceeded
InvalidDomain
} from '../../util/errors-ts';
import { SchemaValidationFailed } from '../../util/errors';

@@ -359,8 +358,7 @@ export default async function main(
firstDeployCall instanceof SchemaValidationFailed ||
firstDeployCall instanceof TooManyCertificates ||
firstDeployCall instanceof TooManyRequests ||
firstDeployCall instanceof InvalidDomain ||
firstDeployCall instanceof FileSizeLimitExceeded
firstDeployCall instanceof InvalidDomain
) {
handleCreateDeployError(output, firstDeployCall);
return 1;
@@ -435,8 +433,7 @@ export default async function main(
secondDeployCall instanceof DomainVerificationFailed ||
secondDeployCall instanceof SchemaValidationFailed ||
secondDeployCall instanceof TooManyCertificates ||
secondDeployCall instanceof TooManyRequests ||
secondDeployCall instanceof FileSizeLimitExceeded
secondDeployCall instanceof TooManyRequests
) {
handleCreateDeployError(output, secondDeployCall);
return 1;
@@ -696,10 +693,6 @@ function handleCreateDeployError(output, error) {
);
return 1;
}
if (error instanceof FileSizeLimitExceeded) {
output.error(`File size limit exceeded.`);
return 1;
}

return error;
}
@@ -36,10 +36,6 @@ export default async function createDeploy(
);
}

if (error.code === 'size_limit_exceeded') {
return new ERRORS_TS.FileSizeLimitExceeded()
}

// If the cert is missing we try to generate a new one and the retry
if (error.code === 'cert_missing') {
const result = await generateCertForDeploy(
Copy path View file
@@ -931,13 +931,3 @@ export class InvalidMoveToken extends NowError<
});
}
}

export class FileSizeLimitExceeded extends NowError<'FILE_SIZE_LIMIT_EXCEEDED', {}> {
constructor() {
super({
code: 'FILE_SIZE_LIMIT_EXCEEDED',
meta: {},
message :'File size limit exceeded'
})
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.