title: How to throw custom exception with custom error code on fly in django rest framework and override default fields in exception response
body: <p>I would like to know how can I throw custom exception in django rest framework, that contains custom error_code and custom message. I am not interested in <strong>APIException()</strong> since this function does not allow for setting error code on fly. Additionally, I would like to know how to change the <strong>details</strong> key json response of exception message.</p>