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

Illegal operation on a directory #123

Closed
adamaltman opened this issue Apr 19, 2020 · 1 comment
Closed

Illegal operation on a directory #123

adamaltman opened this issue Apr 19, 2020 · 1 comment
Labels
Type: Bug Something isn't working

Comments

@adamaltman
Copy link
Member

If someone accidentally made a $ref that points to a directory instead of a file, it will result in an unfriendly error.

(node:30324) UnhandledPromiseRejectionWarning: Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:564:3)
    at tryReadSync (fs.js:353:20)
    at Object.readFileSync (fs.js:390:19)
    at resolve (/Users/adam/Projects/Rebilly/api-definitions/node_modules/@redocly/openapi-cli/dist/resolver.js:88:28)
    at resolveNode (/Users/adam/Projects/Rebilly/api-definitions/node_modules/@redocly/openapi-cli/dist/resolver.js:231:28)
    at onNodeEnter (/Users/adam/Projects/Rebilly/api-definitions/node_modules/@redocly/openapi-cli/dist/traverse.js:92:35)
    at traverseNode (/Users/adam/Projects/Rebilly/api-definitions/node_modules/@redocly/openapi-cli/dist/traverse.js:112:29)
    at traverseChildren (/Users/adam/Projects/Rebilly/api-definitions/node_modules/@redocly/openapi-cli/dist/traverse.js:49:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async traverseNode (/Users/adam/Projects/Rebilly/api-definitions/node_modules/@redocly/openapi-cli/dist/traverse.js:140:30)
(node:30324) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:30324) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@adamaltman adamaltman added the Type: Bug Something isn't working label Apr 19, 2020
@adamaltman
Copy link
Member Author

This is solved by #146

[4] issue-145.yaml:21:11 at #/paths/~1/post/responses/200

Can't resolve $ref: EISDIR: illegal operation on a directory, read

19 | responses:
20 |   200:
21 |     $ref: "../"
   |     ^^^^^^^^^^^
22 | tags:
23 |   - Testing

Error was generated by the no-unresolved-refs rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant