finer grained error handling