Use Error types when rejecting a promise. Refs #11