Interface IExceptionHandler
중앙 예외 처리 계약. 모든 try-catch 블록에서 이 인터페이스를 통해 처리한다.
public interface IExceptionHandler
Examples
try
{
await _assetSystem.LoadAsync<GameObject>(key, ct);
}
catch (Exception e) when (e is not OperationCanceledException)
{
_exceptionHandler.Handle(e, "[MySystem] 에셋 로드 실패");
}
Remarks
[규칙] 복구 가능한 경우에만 try-catch 사용. 복구 불가능한 예외는 catch하지 않는다. OperationCanceledException은 내부에서 자동으로 무시된다(정상 취소로 처리). IOException 등 I/O 오류는 Warning, 그 외는 Error로 분기된다.
Methods
Handle(Exception, string)
예외를 심각도에 따라 처리(로그 출력).
void Handle(Exception exception, string context = "")
Parameters
exceptionException처리할 예외.
contextstring오류 발생 위치 또는 추가 설명 (예: "[MySystem] 로드 실패").