You could just allow this exception to percolate, rather than catching it and returning a status code. Or, you could make a more meaningful exception class an raise that.