decentraland / decentraland/builder-client

Detecting wearable.json errors is cumbersome

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3
Forks
4
PR merge metrics
No merged PRs in 30d

Description

## 🎉 Description

When loading a new zip file using `loadFile`, if the wearable.json configuration is invalid, the error thrown is: `InvalidWearableConfigFileError`. The thing is that the errors are a bit hidden behind `error.getErrors()` "forcing" the client user to do something like this:

```ts
if (error instanceof InvalidWearableConfigFileError) {
throw new Error(`${error.message}. Errors: ${JSON.stringify(error.getErrors())}`)
}
```

if wanting to show a meaningful error message.

Could it be possible to have a better error message? or maybe handle this in another way (the error is just AJV gibberish)

- [ ] 🐛 This is a bug report.
- [x] 📈 This is a feature request.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.