Skip to content

Commit

Permalink
docs: Adjusted try/catch
Browse files Browse the repository at this point in the history
Removed try catch in favour of result because it doesn't throw an error

BREAKING CHANGE: N
  • Loading branch information
codingwithmanny authored and codingwithmanny committed Jan 2, 2023
1 parent a71ecde commit ff7cf33
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/validate-open-rpc-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ export class OpenRPCDocumentValidationError implements Error {
*
* import { validateOpenRPCDocument } from "@open-rpc/schema-utils-js";
* const badOpenRPCDocument = {} as any;
* try {
* const isValid = validateOpenRPCDocument(badOpenRPCDocument);
* if (isValid) {
* // handle validity
* }
* } catch (error) {
* // handle error
*
* const result = validateOpenRPCDocument(badOpenRPCDocument);
* if (result !== true) {
* console.error({ error: result })
* }
* ```
*
*/
Expand Down

0 comments on commit ff7cf33

Please sign in to comment.