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

refactor: Move PosixError class where it can be accessed outside of Phoenix #413

Merged
merged 3 commits into from
May 30, 2024

Conversation

AtkinsSJ
Copy link
Collaborator

This class is generally useful if we want to convert between Puter and Node-style errors.

  • Move PosixError from phoenix to puter-js-common package.
  • Move Phoenix's functions for converting Node or Puter errors into PosixErrors, into the PosixError class itself.
  • Store the posix error code's string name as PosixError.code, which is expected by some libraries that are used to Node errors.

The in-progress git client also needs to use this. puter-js-common uses
commonjs modules, so it had to be adjusted for that.
Specifically, this makes the Puter->PosixError conversion available to
the in-progress git client.
This matches the behaviour of Node.JS's errors, and some libraries
expect it.
@AtkinsSJ AtkinsSJ mentioned this pull request May 22, 2024
@KernelDeimos KernelDeimos merged commit a62a56f into HeyPuter:main May 30, 2024
6 checks passed
@AtkinsSJ AtkinsSJ deleted the extract-posix-error branch May 31, 2024 08:07
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.

None yet

2 participants