-
Notifications
You must be signed in to change notification settings - Fork 41
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
Standardize and document the errors that can arise from builtins
#700
Comments
@jmcook1186 is this different from the list of exceptions 3rd party plugin authors will be able to raise? I suspect it's the same right. Re Naming: Re Packaging: NOTE: If we go this approach it needs to work for both plain old javascript and TS, we shouldn't force everyone to use TS. |
Hi @jawache This is just trying to get all the errors we currently emit under control and properly documented so we can have an informed conversation for #600. The list of error types and messages is supposed to cover all the For plugin builders the current assumption is that we will explain and encourage our practices but won't impose hard requirements on how plugins handle their errors. We don't want cumbersome error handling protocols to be a barrier to quickly executing prototype plugins, in my opinion. However, this is something we need to discuss in detail in #600 |
Thanks @jmcook1186 ,
So I'd like to correct that assumption somewhat. The interface to plugins is both the function signature we expect but also the exceptions that they should throw. Both of these together form the "interface" to the plugin and the contract the plugin has with the If framework. They can have whatever exception names they want for their internal logic - we're not forcing that at all, call internal logic whatever you want. But exceptions that they pass up to IF should be from a library of exceptions that we ask them to throw in different situations. There are also a set of exceptions which we should explore where the plugin author can ask for some help, we've discussed before something like a So I agree the first step is getting it all documented, but the second step is figuring out what's missing and deciding if we want to supporting those as well (and also perhaps renaming them to be easier to understand) |
ok, thanks for explaining. We are on the same page - let's get the full set of current exceptions enumerated and then we audit and refine. |
Error classes that are used across |
Closing as this is rolled into #593 |
Spun out from #337
What
Standardize the errors that can arise in our
builtins
and document them onif.greensoftware.foundation
Why
To support our efforts
Context
To support our efforts to improve the IF debugging experience, we first enumerated the error types and messages that can arise from our core IF features. However, when we began doing the same for the plugins we maintain, we realized they were too disparate and non-uniform to document well. We interpret this as a signal that we need to standardize the way we surface errors from our standard library of
builtins
, including those that are being migrated in fromif-plugins
.To this end, this ticket covers the standardization of the errors surfaced by our
builtins
into a finite set of types. The task is to go through all the error and log messages emitted by ourbuiltins
, drop/replace any that can be dropped/replaced so we maintain the minimum viable set of error types, and ensure all the error messages emitted acrossbuiltins
are attached to one of those types. For example, no errors should be handled usingconsole.log(<error message>)
, but instead should be handled similarly tothrow new InputValidationError('Config is not provided.')
.Once this is done, the remainder of the task is to document these error types and messages.
For each
builtin
, the README should include a comprehensive list of the error messages it can emit, organized by error type and including an explanation of the conditions that can cause the error to be thrown.e.g.
Example: Groupby README
... rest of readme ...
Errors
InputValidationError
groupby
plugin was not availablegroupby
plugin, as explained [here](link to relevant docs)Prerequisites/resources
Plugins need to have been migrated over to
builtins
(in progress)Acceptance criteria
ErrorType: error message
syntax and use to a known, minimal set of types.WHEN I run
ie --manifest <manifest>
with errorsTHEN the error is always attached to a known error class
builtins
WHEN I navigate to
if/src/util
THEN I find a file
errors.ts
that contains an arrayCUSTOM_ERRORS
that lists 100% of the defined error types supporting all the IF features and builtinsif.greensoftware.foundation
WHEN I navigate to
if.greensoftware.foundation/reference/errors
THEN I see the list of error types with a brief explanation of the kinds of behaviours that cause them to be emitted, with real examples from our codebase
builtin
includes a comprehensive list of the error messages the builtin can emit, with reasons and remedies linking to the appropriate docs.WHEN I visit if.greensoftware.foundation/reference/errors
THEN I find a comprehensive list of the error types F can emit and understand when and why they are used.
WHEN I run
npx jest --coverage
THEN I see a coverage report showing 100% coverage and 100% passing
SoW (scope of work)
builtins
and core featuresif-greensoftware.foundation
The text was updated successfully, but these errors were encountered: