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

Unify error codes used for typechecking and at runtime #6391

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

robertknight
Copy link
Member

Depends on #6390.

Unify the lists of LTI error codes used for typechecking and matched at runtime
against server error messages.

This makes adding new error codes easier and avoids a potential hazard where a
new error code is added to one list but not the other.

@robertknight robertknight requested a review from marcospri June 25, 2024 11:18
| 'moodle_student_not_in_group'
| 'vitalsource_no_book_license'
| 'vitalsource_user_not_found';
(typeof ltiLaunchServerErrorCodes)[number];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is "type of the elements in the array"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly. It is expressed as "get type of value returned by indexing into the array with a number".

Copy link
Member

@marcospri marcospri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I think I've hit this when adding new error codes 👍

Base automatically changed from canvas-submission-max-attempts-fe to main June 25, 2024 14:15
Unify the lists of LTI error codes used for typechecking and matched at runtime
against server error messages.

This makes adding new error codes easier and avoids a potential hazard where a
new error code is added to one list but not the other.
@robertknight robertknight force-pushed the unify-compile-runtime-error-codes branch from 6144412 to aff59f7 Compare June 25, 2024 14:16
@robertknight robertknight merged commit 0ff3c35 into main Jun 25, 2024
9 checks passed
@robertknight robertknight deleted the unify-compile-runtime-error-codes branch June 25, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants