How to get Okta authentication status code programatically in Electron app

My usecase :

I have an electron application which uses okta for authentication. On okta login page which is a separate domain the user authentication may succeed or fail depending on the password being right or wrong. For success the okta automatically redirects to implicit callback and user proceeds as per usual application flow. For the failed case I need to know that it is a failure and get the status code and depending upon that show user some dialog box or anything else which is secondary. My requirement is to know that authentication failed and get the status code for failure.

Please provide your insights.