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

[MMB-44] Ensure we're setting proper error codes #135

Merged
merged 4 commits into from
Aug 25, 2023
Merged

Conversation

surminus
Copy link
Collaborator

The majority of errors we are throwing are default InvalidArgumentError type errors.

Otherwise, we only really have two other errors:

  1. Attempting to connect to a space where the name is missing
  2. Trying to do something when they have entered a space

I've copied the way that locks used errors.

@surminus surminus changed the title Ensure we're setting proper error codes [MMB-44] Ensure we're setting proper error codes Aug 24, 2023
Copy link
Member

@lmars lmars left a comment

Choose a reason for hiding this comment

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

LGTM

The majority of errors we are throwing are default InvalidArgumentError
type errors.

Otherwise, we only really have two other errors:

1. Attempting to connect to a space where the name is missing
2. Trying to do something when they have entered a space

I've copied the way that locks used errors.
Let's ensure we never have a throw that isn't at least a standard
generic error code.
Copy link
Member

@Srushtika Srushtika left a comment

Choose a reason for hiding this comment

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

@surminus I've suggested some change in wording so it's more contextual. wdyt?

src/Errors.ts Outdated Show resolved Hide resolved
src/Cursors.ts Outdated Show resolved Hide resolved
src/Errors.ts Outdated Show resolved Hide resolved
src/Locations.ts Outdated Show resolved Hide resolved
src/Locations.ts Outdated Show resolved Hide resolved
src/Locks.ts Outdated Show resolved Hide resolved
src/Locks.ts Outdated Show resolved Hide resolved
src/Locks.ts Outdated Show resolved Hide resolved
src/Space.ts Outdated Show resolved Hide resolved
src/Space.ts Outdated Show resolved Hide resolved
@surminus
Copy link
Collaborator Author

@Srushtika I went with OUT_OF_SPACE error as a reference to the Prodigy song, but I'm happy to do something more useful as suggested! 😉

@surminus
Copy link
Collaborator Author

@Srushtika updated!

@surminus surminus marked this pull request as ready for review August 25, 2023 09:50
@surminus surminus merged commit 695e0dc into main Aug 25, 2023
5 checks passed
@surminus surminus deleted the mmb-44-error-codes branch August 25, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants