Skip to content

Commit

Permalink
[eas submit] Add missing iOS error messages (#125)
Browse files Browse the repository at this point in the history
* Handle iOS missing app icon error
* Handle invalid signature error
  • Loading branch information
barthap committed Dec 14, 2020
1 parent d8452ce commit 1094d3f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion packages/eas-cli/src/submissions/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ enum SubmissionErrorCode {
ANDROID_FIRST_UPLOAD_ERROR = 'SUBMISSION_SERVICE_ANDROID_FIRST_UPLOAD_ERROR',
ANDROID_OLD_VERSION_CODE_ERROR = 'SUBMISSION_SERVICE_ANDROID_OLD_VERSION_CODE_ERROR',
ANDROID_MISSING_PRIVACY_POLICY = 'SUBMISSION_SERVICE_ANDROID_MISSING_PRIVACY_POLICY',
IOS_OLD_VERSION_CODE_ERROR = 'SUBMISSION_SERVICE_IOS_OLD_VERSION_CODE_ERROR',
IOS_UNKNOWN_ERROR = 'SUBMISSION_SERVICE_IOS_UNKNOWN_ERROR',
IOS_MISSING_APP_ICON = 'SUBMISSION_SERVICE_IOS_MISSING_APP_ICON',
IOS_INVALID_SIGNATURE = 'SUBMISSION_SERVICE_IOS_INVALID_SIGNATURE',
}

const SubmissionErrorMessages: Record<SubmissionErrorCode, string> = {
Expand All @@ -28,14 +32,31 @@ const SubmissionErrorMessages: Record<SubmissionErrorCode, string> = {
[SubmissionErrorCode.ANDROID_MISSING_PRIVACY_POLICY]:
'The app has permissions that require a privacy policy set for the app.\n' +
`${learnMore('https://expo.fyi/missing-privacy-policy')}.`,
[SubmissionErrorCode.IOS_OLD_VERSION_CODE_ERROR]:
"You've already submitted this version of the app.\n" +
'Versions are identified by Build Numbers (expo.ios.buildNumber in app.json).\n' +
"If you're submitting an Expo project built with EAS Build, increment the build number in app.json and build the project again." +
`${learnMore('https://expo.fyi/bumping-ios-build-number')}.`,
[SubmissionErrorCode.IOS_UNKNOWN_ERROR]:
"We couldn't figure out what went wrong. Please see logs to learn more.",
[SubmissionErrorCode.IOS_MISSING_APP_ICON]:
'Your iOS app icon is missing or is an invalid format. The icon must be a 1024x1024 PNG image with no transparency.\n' +
'Please check your icon image and icon configuration in app.json.\n' +
`${learnMore('https://docs.expo.io/guides/app-icons/')}`,
[SubmissionErrorCode.IOS_INVALID_SIGNATURE]:
'Your app signature seems to be invalid.\n' +
"Please check your iOS Distribution Certificate and your app's Provisioning Profile.\n" +
`${learnMore('https://docs.expo.io/distribution/app-signing')}`,
};

export function printSubmissionError(error: SubmissionError): boolean {
if ((Object.values(SubmissionErrorCode) as string[]).includes(error.errorCode)) {
const errorCode = error.errorCode as SubmissionErrorCode;
log.addNewLineIfNone();
log.error(SubmissionErrorMessages[errorCode]);
return errorCode === SubmissionErrorCode.ANDROID_UNKNOWN_ERROR;
return [SubmissionErrorCode.ANDROID_UNKNOWN_ERROR, SubmissionErrorCode.IOS_UNKNOWN_ERROR].some(
code => code === errorCode
);
} else {
log(error.message);
return true;
Expand Down

0 comments on commit 1094d3f

Please sign in to comment.