fix/idanluf/apps-CLI-error-handeling-fixes#138
Merged
Conversation
Added API error messages for invalid tokens & Added new test for it Added file size validation for uploads.
gregra81
reviewed
Nov 16, 2025
Comment on lines
+61
to
+62
| const isEmptyResponse = !errorAxiosResponse?.message && !title; | ||
| const isAuthError = statusCode === 406 && isEmptyResponse; |
Collaborator
There was a problem hiding this comment.
add a new function that is called isAuthError and add jsdoc why did this is how it works
gregra81
reviewed
Nov 16, 2025
| }; | ||
|
|
||
| const checkFileSizesInDirectory = (directoryPath: string): void => { | ||
| const MAX_FILE_SIZE_MB = 75; |
Collaborator
There was a problem hiding this comment.
move to the beginning of the file or in a consts file
gregra81
reviewed
Nov 16, 2025
|
|
||
| describe('ApiService', () => { | ||
| it('should throw HttpError with helpful token message for invalid token', async () => { | ||
| const { execute } = await import('services/api-service'); |
Collaborator
There was a problem hiding this comment.
move the import to the top of the file and change to static import
gregra81
reviewed
Nov 16, 2025
| const fullPath = path.join(dir, item); | ||
| const stats = fs.statSync(fullPath); | ||
|
|
||
| if (stats.isDirectory()) { |
Collaborator
There was a problem hiding this comment.
please add a stopping condition to the recursion
Collaborator
|
@idanluf bump the version by patch in package.json |
package.json: bump the version api-service.test: fix imports order push-service: add max_depth to recursion api-service: create new function of isAuthError
0a8c518 to
aff1f8d
Compare
gregra81
reviewed
Nov 16, 2025
| const checkFileSizesInDirectory = (directoryPath: string): void => { | ||
| const checkDirectory = (dir: string, depth = 0) => { | ||
| if (depth > MAX_RECURSION_DEPTH) { | ||
| return; |
Collaborator
There was a problem hiding this comment.
instead throw a descriptive error for the end user to change the depth of his project to be less than MAX_RECURSION_DEPTH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
commands/Scheduler/*.ts:
remove excessive try-catch blocks: to improve error handling.
api-service.ts & api-service-test.ts:
Fix the token error handling to prompt the user directly when an incorrect token is supplied
& Added a test that checks it
push-service.ts:
Add file size verification to the push command, ensuring files do not exceed 75 MB.
https://monday.monday.com/boards/3670992828/views/126769350/pulses/18326407407