UmbrellaException class
A Exception that collects a Set of child Exceptions together. Typically thrown after a loop, with all of the exceptions thrown during that loop, but delayed so that the loop finishes executing.
class UmbrellaException implements Exception {
/**
* A message describing the format error.
*/
Set<Exception> _causes;
UmbrellaException(this._causes) {
throw (makeCause(_causes));
}
Set<Exception> get causes => _causes;
String toString() => makeMessage(_causes);
static String makeMessage(Set<Exception> causes) {
if (causes.length == 0) {
return null;
}
StringBuffer b = new StringBuffer();
for (Exception t in causes) {
if (b.length > 0) {
b.write("; ");
}
b.write(t.toString());
}
return b.toString();
}
static Exception makeCause(Set<Exception> causes) {
Iterator<Exception> iterator = causes.iterator;
if (!iterator.moveNext()) {
return null;
}
return iterator.current;
}
}
Subclasses
Implements
Static Methods
String makeMessage(Set<Exception> causes) #
static String makeMessage(Set<Exception> causes) {
if (causes.length == 0) {
return null;
}
StringBuffer b = new StringBuffer();
for (Exception t in causes) {
if (b.length > 0) {
b.write("; ");
}
b.write(t.toString());
}
return b.toString();
}
Exception makeCause(Set<Exception> causes) #
static Exception makeCause(Set<Exception> causes) {
Iterator<Exception> iterator = causes.iterator;
if (!iterator.moveNext()) {
return null;
}
return iterator.current;
}
Constructors
new UmbrellaException(Set<Exception> _causes) #
Properties
final Set<Exception> causes #
Set<Exception> get causes => _causes;
Methods
String toString() #
Returns a string representation of this object.
docs inherited from Object
String toString() => makeMessage(_causes);