package com.codebyte.api.common.error;

import lombok.Getter;

/**
 * Base type for application exceptions that map cleanly to an HTTP {@link ErrorCode}. The global
 * handler renders any {@code ApiException} as an RFC 7807 problem with the code's status and title.
 */
@Getter
public abstract class ApiException extends RuntimeException {

    private final transient ErrorCode errorCode;

    protected ApiException(ErrorCode errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }
}
