Skip to content

Need to decide how errors should be handled #7

@danielytics

Description

@danielytics

A number of potential errors may occur that currently aren't handled very well:

  1. invalid data passed to precompile or compile. Need to validate that this isn't the case (as a function precondition?)
  2. invalid node structure during transformations (currently, shouldn't happen as long as hiccup is properly normalised, but currently normalisation does not handle invalid data properly)
  3. transformation arguments should be validated somehow (eg set-attr takes two keywords, most others take only one keyword)
  4. transformations whose selectors are not found in the template are silently ignored
  5. actions which are not found in the action-map are silently ignored

What needs to be done:

  • Need to validate inputs to precompile and compile and throw an exception if not valid.
  • Hiccup normalisation needs to detect malformed data and throw an exception
  • Action map should include a "schema" for the arguments. Compile should throw an exception if the supplied actions do not match the schema.
  • Decide if unused transformations should be silently ignored, output a warning or throw an exception
  • Actions not found in the action-map should either throw an exception or generate a warning (need to decide which)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions