All tests passing again

Added an ErrorCode type as a stopgap until better error handling is
available