> For the complete documentation index, see [llms.txt](https://docs.ohmyapp.io/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ohmyapp.io/main/guide/develop_app/command-execute-function/create-logic/conditions/detailed-processing-conditions/returnexception.md).

# @returnException

* 예외(Exception)란? 개발자가 구현한 로직에서 발생한 실수나 사용자의 영향에 의해 발생해요.
* returnException은 예외를 발생시켜요.
* 동적 코딩 실행 중에 문제가 있다고 판단될 시 실행을 종료하고 예외에 관한 내용을 담아서 메세지와 예외 코드를 보여줄 수 있어요.
* 로직 실행을 단순히 종료하고 싶을 때도 사용해요.

ex) 현재 유저가 구독 중이 아닐 경우 로직 실행을 종료할 때, documentJson에서 주문 정보의 값이 없을 경우 실행을 종료할 때 등

**사용 방법**

<figure><img src="/files/AmZ9JOJE8IQxgJBTcZXC" alt=""><figcaption></figcaption></figure>

1. 로직 설정 ➡︎ If When, Where에 원하는 값 입력 ➡︎ New data query 를 펼쳐 주세요. &#x20;
2. Event에서 @returnException을 드래그앤드롭하여 원하는 위치(flows, #ifTrue, #ifFalse, @for)에 넣어주세요.
3. \#message에는 예외 발생 시 표시할 메세지를 설정해요.

<div align="left"><figure><img src="/files/RzPL6vmrULCrjUcebdQE" alt="" width="563"><figcaption></figcaption></figure></div>

**필드 설명**

* \#message (모든 타입) (필수)
  * message(String) \
    예외 발생 시 나올 메세지를 설정해요. \
    예외 메세지 작성시 .(온점)이 들어가면 메세지 맨 앞에 !(느낌표)를 붙여야 해요.&#x20;
  * code(숫자) (선택)\
    exception 과 달리 code 가 강제되지 않아요.\
    1을 입력하면 정상 작동되므로 예외를 발생시키지 않아요.\
    1이 아닌 다른 숫자도 입력 가능해요.

2024.01.16 Jinny
