* [eas-cli] Update apple utilities to avoid the maintenance error
* [eas-cli] Add changelog entry
* [eas-cli] Dont change the eas-cli version
* [eas-cli] Fix changelog entry
* [eas-cli] fix it again
* Unify error display method
Overriden the `Command`'s `catch` method to catch all the errors thrown by the commands, log the error message there the same way as it was previously handled in `src/build/build.ts` and re-throw generic `Error` instance with predefined base error message.
To avoid duplication, old `Log.error()` calls have been removed from `src/build/build.ts`.
Also added tests to see if the `catch()` method works as intended.
* Adjust base error messages
Base error messages have been adjusted after @dsokal suggested that the error may be caused by something different from a request and displaying message about a failed request is misleading
* update CHANGELOG.md
* Add test for unclean error message
Checks if the `[GraphQL] ` prefix gets removed when logging the error message
* Update handling GraphQL errors
Post-review update to how graphQL errors are handled
* Print different message for graphQL errors
When a graphQL error is caught a different base error message is printed
* Print original error to debug
When a graphQL error is caught and the message is cleaned, an original message is printed to debug (or just the same message otherwise)
* Add custom error classes
Created some custom error classes for known server side defined errors
* Log the error, not the message
Changed the debug log to log the error object, not the error message
* Fix
Fixed testing leftover
* Change phrasing
Edited the phrasing in default messages related to EAS Build
* Update if condition
Changed the if condition after review comment
* Create error base class
Created a new base class for the errors expected in build.ts, so they can be handled separately in `catch()`
* Move EasCommand properties
Moved the class properties above the class methods
* Remove helper method
Removed the helper method after review comment
* Change const type
Updated the type of SERVER_SIDE_DEFINED_ERRORS constant
* Change default base error message
Set the default base error message to `<command_name> command failed.`
* Remove comments
Removed leftover comments
* Change optional property
Changed empty string to optional property
* Post-review tweaks
Self-explanatory
* Fix failing test
One of tests started failing after changing the coalescing operators (|| -> ??). This fixes that test
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
* Remove error class
Removed `GenericGraphQLError` class after @wkozyra95 comment, since atm there's no need to handle it differently than a generic `Error`
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
* Move `EasCommandError` base class
Moved `EasCommandError` base class after @wkozyra95 comment. The class is not specific to `Build` command and so it has been moved to `commandUtils` directory
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
* Make message mandatory
Made `message` parameter in `EasCommandError`s mandatory, to remove need for providing a fallback string and making the server the source of truth for the errors messages
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
* Update packages/eas-cli/src/commandUtils/EasCommand.ts
Co-authored-by: Wojciech Kozyra <[email protected]>
* Move `baseGraphQLErrorMessage` property
Made the property into a constant in a global scope, since atm it is not changed in any of the subclasses
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
* Suppress ESLint warning
ESLint erroneously complains about the constructor of `EasCommandError` to be useless, which is not true is the constructor of `Error` parent class allows for optional `message` parameter and the constructor of `EasCommandError` does not
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
* Add error handling tests
Added a bunch of new tests related to the `handleBuildRequestError` function
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
* Directly export `handleBuildRequestError`
Dropped the `testExports` convention after team discussion
See: https://linear.app/expo/issue/ENG-6945/improve-eas-cli-error-logging
---------
Co-authored-by: Wojciech Kozyra <[email protected]>