Class Errors


public final class Errors
extends java.lang.Object
A collection of error messages. If this type is passed as a method parameter, the method is considered to have executed successfully only if new errors were not added to this collection.

Errors can be chained to provide additional context. To add context, call withSource(java.lang.Object) to create a new Errors instance that contains additional context. All messages added to the returned instance will contain full context.

To avoid messages with redundant context, withSource(java.lang.Object) should be added sparingly. A good rule of thumb is to assume a method's caller has already specified enough context to identify that method. When calling a method that's defined in a different context, call that method with an errors object that includes its context.