Fix TypeError: error() takes at least 2 arguments (1 given)