rametta / rapini

:leafy_green: OpenAPI to React Query (or SWR) & Axios
Apache License 2.0
147 stars 17 forks source link

correctly blow up #34

Closed cn-johndpope closed 1 year ago

cn-johndpope commented 1 year ago

this will correctly throw error message

node:internal/process/promises:288 triggerUncaughtException(err, true / fromPromise /); ^

[UnhandledPromiseRejection: 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(). The promise rejected with the reason "Missing "operationId" from "post" request with pattern /api/meters/{orgId}/AddNote".] { code: 'ERR_UNHANDLED_REJECTION' }

rametta commented 1 year ago

Hi @cn-johndpope this seems like it would silently fail, I would rather it throws a very specific error if anything

rametta commented 1 year ago

Hi @cn-johndpope , I've pushed an update to version 2.4.0 now available on npm. It should output errors a lot more clear now in the CLI. You can see the changes here if you're curious https://github.com/rametta/rapini/commit/a32be8d55e6bd32499bedca2029c83499616d201 Thanks for opening a PR and reporting the problem. Cheers 🍻

cn-johndpope commented 1 year ago

with this comment "is seems like it would silently fail, I would rather it throws a very specific error if anything" when the string is returned empty - another method of yours correctly trips up rendering the error correctly. when the operationId is undefined - it fails like this

https://github.com/rametta/rapini/issues/33