spec for error handling (to be done later)