Refactored 'error.go'