Closed
Description
Description 📝
Would be great to throw all library errors from the same class in order to have a single place to create documentation for them. Also, this is beneficial in cases where many components throw the same errors.
Suggested solution 💡
Create a core Errors class with static properties to throw a document errors:
class Errors {
/**
* Indications on what the error means and how the developer can solve it.
*/
noWorld = new Error("No world found!")
}
From any component:
import { Errors } from "core"
class Component {
someMethod() {
if (somethingFails) {
throw new Errors.noWorld
}
}
}
Alternative ⛕
No response
Additional context ☝️
No response
Validations ✅
- Read the docs.
- Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.