package ru.nbch.indicsearchservice.exception;

import ru.nbch.indicsearchservice.dto.response.InternalExceptionResponseDto;

public class InternalException extends RuntimeException {
    private final String message;

    public InternalException(String message) {
        super(message);
        this.message = message;
    }

    public InternalException(Throwable cause) {
        super(cause);
        this.message = cause.getMessage();
    }

    public InternalExceptionResponseDto getInternalExceptionResponseDto() {
        return new InternalExceptionResponseDto(this.message);
    }
}
