Create errors that can be both thrown and returned. Make error handling easier for both JavaScript and TypeScript.