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

fix(node/fs): missing uv error context for readFile #27011

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

marvinhagemeister
Copy link
Contributor

Dart's Node wrapper code in npm:sass does string slicing on the thrown error message which broke because of our missing uv error context.

Code in question:

_systemErrorToFileSystemException0(callback) {
  var error, t1, exception, t2;
  try {
    t1 = callback.call$0();
    return t1;
  } catch (exception) {
    error = A.unwrapException(exception);
    if (!type$.JsSystemError._is(error))
      throw exception;
    t1 = error;
    t2 = J.getInterceptor$x(t1);
    throw A.wrapException(new A.FileSystemException0(J.substring$2$s(t2.get$message(t1), (A.S(t2.get$code(t1)) + ": ").length, J.get$length$asx(t2.get$message(t1)) - (", " + A.S(t2.get$syscall(t1)) + " '" + A.S(t2.get$path(t1)) + "'").length), J.get$path$x(error)));
  }
}

Fixes #26994

Dart's Node wrapper code in npm:sass does string slicing on the thrown error message which broke because of our missing uv error context
Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

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

LGTM

@marvinhagemeister marvinhagemeister merged commit 50538ba into main Nov 22, 2024
17 checks passed
@marvinhagemeister marvinhagemeister deleted the readfile-node-error branch November 22, 2024 21:42
bartlomieju pushed a commit that referenced this pull request Nov 28, 2024
Dart's Node wrapper code in `npm:sass` does string slicing on the thrown
error message which broke because of our missing uv error context.

Code in question:

```js
_systemErrorToFileSystemException0(callback) {
  var error, t1, exception, t2;
  try {
    t1 = callback.call$0();
    return t1;
  } catch (exception) {
    error = A.unwrapException(exception);
    if (!type$.JsSystemError._is(error))
      throw exception;
    t1 = error;
    t2 = J.getInterceptor$x(t1);
    throw A.wrapException(new A.FileSystemException0(J.substring$2$s(t2.get$message(t1), (A.S(t2.get$code(t1)) + ": ").length, J.get$length$asx(t2.get$message(t1)) - (", " + A.S(t2.get$syscall(t1)) + " '" + A.S(t2.get$path(t1)) + "'").length), J.get$path$x(error)));
  }
}
```

Fixes #26994
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.

Deno panic when using file:/// url with sass
2 participants