Skip to content

Structured errors

Compare
Choose a tag to compare
@sethbrite sethbrite released this 06 Feb 23:32
· 224 commits to master since this release

Introduction

Conformity errors are now returned as Error instances instead of plain error message strings.

Change overview

  • Error messages are now found in the message attribute of an Error instance.
  • If you are validating a container type (List, Dictionary, etc.), the pointer attribute of returned Error instances will also be set. Error pointers allow you to more easily identify the key or index that generated the error.

Error pointer format

(pointer)      => (key_or_index).(pointer) | (key_or_index)
(key_or_index) => (dictionary key) | (list/tuple index)

Example error pointer: people.3.address.zip