package org.onedatashare.server.model.error;

import org.onedatashare.server.service.ODSLoggerService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * This Class provides a deafault method of handling exceptions throughout the project
 * */
@ControllerAdvice
public class GlobalExceptionHandler {

    /**
     * Exception handler for Invalid Login i.e., unauthorized use of the service
     * @param ilException : Invalid Exception Object
     * */
    @ExceptionHandler(InvalidODSCredentialsException.class)
    public ResponseEntity<InvalidODSCredentialsException> handle(InvalidODSCredentialsException ilException){
        ODSLoggerService.logError(ilException.toString());
        return new ResponseEntity<>(ilException, ilException.status);
    }

}

@@ -671,38 +671,14 @@
 ity%3C
-InvalidODSCredentialsException
+String
 %3E ha
@@ -833,16 +833,27 @@
 xception
+.toString()
 , ilExce

Update GlobalExceptionHandler.java