Core-637 Changed the runtime exception to bad credentials for 500 error

Changed the runtime exception to bad credentials for 500 error