Answers.Body: <p>I believe api4 throws API_Exception and sometimes Exception.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-09T18:27:50.530Z
Answers.Text: Agree, e.g. https://github.com/civicrm/civicrm-core/blob/5.21.0/Civi/Api4/Generic/Result.php#L85
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-09T18:22:03.587Z
Answers.LastActivityDate: 2020-01-09T18:31:15.227Z
Answers.LastEditDate: 2020-01-09T18:31:15.227Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>There is a specific Exception for the CiviCRM API3 called CiviCRM_API3_Exception. Is there a similar specific Exception for API4 or do I just catch the standard Exception?</p>
  
Tags: <api><errorhandling>
Title: Is there a specific Exception for the API4 like CiviCRM_API3_Exception?
ThreadText: # Is there a specific Exception for the API4 like CiviCRM_API3_Exception?
  
  (Asked by: username_0 on 2020-01-09)
  
  There is a specific Exception for the CiviCRM API3 called CiviCRM\_API3\_Exception. Is there a similar specific Exception for API4 or do I just catch the standard Exception?
  
  **Tags:** api, errorhandling
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-01-09. Score: 3
  
  I believe api4 throws API\_Exception and sometimes Exception.
  
  > **Comments:**
  > **username_2**: Agree, e.g. https://github.com/civicrm/civicrm-core/blob/5.21.0/Civi/Api4/Generic/Result.php#L85  
  
  ---
  
  