feat: enhance error handling