package org.crunchytorch.coddy.application.exception.handler;

import org.crunchytorch.coddy.application.data.Response;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

public interface IExceptionHandler<T extends Throwable> {

    ResponseEntity<Response> handler(T t);

    default ResponseEntity<Response> handler(T t, HttpStatus status) {
        return new ResponseEntity<>(new Response(t.getMessage()), status);
    }
}

@@ -380,16 +380,158 @@
 atus) %7B%0A
+        return this.handler(t.getMessage(), status);%0A    %7D%0A%0A    default ResponseEntity%3CResponse%3E handler(String message, HttpStatus status) %7B%0A
         
@@ -571,30 +571,23 @@
 esponse(
-t.getM
+m
 essage
-()
 ), statu

add handler method with message as parameter