Skip to content

Releases: merge-simpson/letsdev-error-code-api

Error Code 0.2.0

Choose a tag to compare

@merge-simpson merge-simpson released this 01 Mar 19:49

Korean/국문

Release 0.2.0

Updates

주요 변경 사항은 다음과 같습니다.

  • (기존 기능 수정) 주요 메서드의 네이밍을 짧게 개선했습니다. ("default-" 접두사 제거)
  • (새로운 기능) 에러를 핸들링할 때 추가 동작을 실행하거나 확장 멤버 제공받을 수 있도록, 예외 생성자 및 관련 메서드 목록을 추가했습니다.

Modified Features

  • 일부 메서드의 네이밍을 더욱 짧게 개선했습니다.
    • BaseErrorCode 및 ErrorCode
      • defaultMessage() → message()
      • defaultStatusCode() → statusCode()
      • defaultException() → exception()
      • defaultException(Throwable)→ exception(Throwable)
    • ErrorCode
      • defaultHttpStatus() → httpStatus()
  • 예외 클래스의 상속 구조를 변경하여, CustomException이 BaseCustomException을 상속받도록 통합하였습니다.

New Features

  • 예외 생성자 확장 (BaseCustomException, CustomException)
    • Runnable을 전달받는 생성자를 추가했습니다.
    • Supplier<Map<String, Object>>를 전달받는 생성자를 추가했습니다.
  • 에러코드에서 예외를 생성하는 메서드
    • 오류를 처리할 때 실행할 수 있는 액션을 전달할 수 있습니다.
    • 오류를 처리할 때 실행할 수 있으면서, 확장 멤버를 반환하는 함수를 전달할 수 있습니다.
    • 메서드 목록
      • exception(Runnable)
      • exception(Runnable, Throwable)
      • exception(Supplier<Map<String, Object>>)
      • exception(Supplier<Map<String, Object>>, Throwable)
  • BaseCustomException 및 CustomException 추가 메서드
    • executeOnError(): 등록된 Runnable 액션을 실행합니다.
    • getPayload(): 예외에 부가된 데이터(payload)를 반환합니다.
    • getPayloadOrElse(map): 예외에 부가된 데이터(payload)를 반환하거나 기본 값을 제공합니다.
    • getPayloadOrElseGet(alternativeSupplier): 예외에 부가된 데이터(payload)를 반환하거나 기본 값을 제공합니다.

Build & Release Notifications

  • Gradle 빌드 스크립트(build.gradle.kts)에서 언어 버전을 21에서 8로 변경하여 소스 및 타깃 컴파일 호환성을 확보했습니다.
  • jitpack 설정 파일(jitpack.yml)에서 openjdk21 대신 openjdk8을 사용하도록 업데이트하였습니다.

체인지 로그

Full Changelog: 0.1.0...0.2.0



English/USA

  • English version can have some errors because it is not checked after generated via AI.

Release 0.2.0

Updates

The main changes are as follows:

  • (Modified Feature) Improved the naming of key methods by shortening them. (Removed the "default-" prefix)
  • (New Feature) Added constructors and related method lists for exceptions, enabling additional actions to be executed or extended members to be provided when handling errors.

Modified Features

  • Shortened the naming of some methods.
    • BaseErrorCode and ErrorCode
      • defaultMessage() → message()
      • defaultStatusCode() → statusCode()
      • defaultException() → exception()
      • defaultException(Throwable) → exception(Throwable)
    • ErrorCode
      • defaultHttpStatus() → httpStatus()
  • Changed the inheritance structure of the exception classes so that CustomException now extends BaseCustomException.

New Features

  • Extended exception constructors (BaseCustomException, CustomException)
    • Added a constructor that accepts a Runnable.
    • Added a constructor that accepts a Supplier<Map<String, Object>>.
  • New methods in the error code for creating exceptions:
    • Allows passing an action to be executed when handling the error.
    • Allows passing a function that returns extended members while handling the error.
    • Method list:
      • exception(Runnable)
      • exception(Runnable, Throwable)
      • exception(Supplier<Map<String, Object>>)
      • exception(Supplier<Map<String, Object>>, Throwable)
  • Additional methods for BaseCustomException and CustomException:
    • executeOnError(): Executes the registered Runnable action.
    • getPayload(): Returns the data payload attached to the exception.
    • getPayloadOrElse(map): Returns the data payload attached to the exception or provides a default value.
    • getPayloadOrElseGet(alternativeSupplier): Returns the data payload attached to the exception or provides a default value.

Build & Release Notifications

  • In the Gradle build script (build.gradle.kts), the language version was changed from JDK 21 to JDK 1.8 to ensure source and target compile compatibility.
  • The jitpack configuration file (jitpack.yml) was updated to use openjdk8 instead of openjdk21.

Changelog

Full Changelog: 0.1.0...0.2.0

Error Code 0.1.0

Choose a tag to compare

@merge-simpson merge-simpson released this 19 Sep 18:48

Features

  • Contains the BaseErrorCode interface and the BaseCustomException class, which can be used without a framework.
  • Contains the interface ErrorCode and the class CustomException and can be used with the Spring framework.
  • Use BaseErrorCode or ErrorCode to implement a categorized error code enum class.
    • For example, you can differentiate SignUpErrorCodes and PaymentErrorCodes with each error code enum class.
    • At the same time, you don't need to handle those error codes with each exception class; the interface allows you to handle them in one way.