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

[minor] error handling of mandatory definition #7

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

AndreiRegiani
Copy link
Contributor

When building an incomplete schema: name, fields

Current

Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at new Struct (file:///Users/user/holepunch/pear/node_modules/hyperschema/index.js:154:44)
    at Hyperschema.register (file:///Users/user/holepunch/pear/node_modules/hyperschema/index.js:238:14)
    at HyperschemaNamespace.register (file:///Users/user/holepunch/pear/node_modules/hyperschema/index.js:189:29)
...

This PR

Uncaught Error: Struct @pear/bundle: required 'fields' definition is missing
    at new Struct (file:///Users/user/holepunch/pear/node_modules/hyperschema/index.js:146:13)
    at Hyperschema.register (file:///Users/user/holepunch/pear/node_modules/hyperschema/index.js:246:14)
    at HyperschemaNamespace.register (file:///Users/user/holepunch/pear/node_modules/hyperschema/index.js:197:29)
...

@AndreiRegiani AndreiRegiani added the enhancement New feature or request label Nov 25, 2024
@mafintosh mafintosh merged commit 3f33aa6 into main Nov 25, 2024
3 checks passed
@mafintosh mafintosh deleted the minimal-error-handling branch November 25, 2024 22:00
@mafintosh
Copy link
Contributor

1.0.4 - nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants