Skip to content

Improve YAML reader error handling - #149

Open
creideiki wants to merge 4 commits into
saab-simc-admin:masterfrom
creideiki:yaml-reader-128
Open

Improve YAML reader error handling#149
creideiki wants to merge 4 commits into
saab-simc-admin:masterfrom
creideiki:yaml-reader-128

Conversation

@creideiki

@creideiki creideiki commented Oct 13, 2017

Copy link
Copy Markdown
Contributor

Allow boxes to be empty or YAML hashes, throw errors for everything else.

Testing warehouse error handling is difficult, since pallets cannot exist stand-alone, and it seems like overkill to include an entire (admittedly tiny) warehouse for each kind of error.

Closes #128.

This is a bug fix, and should bump the patch version.

Changelog:

Add a base class PalletJack::Error for all internal errors, and
PalletJack::WarehouseError for semantic errors in the warehouse.
Boxes may legitimately be empty e.g. by commenting things out while
debugging. Otherwise, they must be hashes in order to be merged into
the greater data tree.

Throw a PalletJack::WarehouseError, naming the offending box, if this
constraint is violated.
@creideiki creideiki added the bug label Oct 13, 2017
creideiki added a commit to creideiki/palletjack that referenced this pull request Oct 18, 2017
* c90fa62 Update RuboCop metrics exceeded by error checking in the YAML loader
* cfee07b Enforce boxes being hashes or empty
* 59c7c37 Add exception classes for internal errors
* 3b0be65 Make the traceable YAML parser include file names in error messages
creideiki added a commit to creideiki/palletjack that referenced this pull request Oct 18, 2017
* c90fa62 Update RuboCop metrics exceeded by error checking in the YAML loader
* cfee07b Enforce boxes being hashes or empty
* 59c7c37 Add exception classes for internal errors
* 3b0be65 Make the traceable YAML parser include file names in error messages
@notCalle
notCalle requested a review from me-minus January 26, 2018 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle empty files

1 participant