I’m developing an app to use ERPNext by consuming the REST APIs. I’m able to call the APIs as necessary, but the problem is that when an invalid parameter is used (e.g. incalid password for the login API), the API doesn’t send a proper error with a code in the response. Alternatively, it sends an HTML file (which I believe is the web page displayed on the UI of ERPNext) that includes the error inside it. I even tried to find a pattern to locate the error but unfortunately, the HTML file doesn’t seem to be parsable.
Am I not looking at the right place? And has anyone figured out a way to work around this?