The MSPro Boomi Collection
About
Good Practices & Patterns
Good Practices & Patterns
  • Markus' Boomi Integration
  • Implementation Patterns
    • The Cache Challenge
      • The Get-Or-Create Use-Case
      • PropCache Scripts
    • State Management
      • Example Scenario
      • State-Management in general
      • State-Management Functionality
      • Technical Solutions
        • Boomi File-System Implementation
          • saveState
          • readState & fetchStates
    • Exception Handling
      • Exception vs Error
      • Basic Rules
        • Aggregating Exceptions
      • Exception Handling Pattern
        • User-Defined Exception Messages
        • Catch Exceptions
      • The pattern in practice
        • API Error Handling
          • Single Record Strategy
            • Single Record RES
          • Many Records Strategy (Array)
            • Many Records RES
        • Pre-Condition Check
    • SQL Patterns
      • Script Header
      • General Rules
        • Check using RowCount
        • Check if record exists
        • Pagination and Sorting
        • Parameter - Best Practices
        • Use JSON as a complex parameter
    • Process Patterns
      • Process Route Implementation Pattern
      • Sub-Process or Process Route
    • DateTime
      • The Boomi datetime dilemma
      • Database and Flow
      • Groovy
      • Data Hub
      • Get Current Date
    • Groovy Script Patterns
      • Dynamic Document Properties
      • Dynamic Process Properties
      • Documents
    • Array Elements to Documents
  • MSPro Services
    • Intermediate Storage
      • Example Processes
        • Docs 01 - Update and Create
          • sub.SampleData.Invoice
        • 02 - Upsert and Get
    • Render Templates
  • Tips
Powered by GitBook
On this page
  • Uncontrolled Exceptions
  • Technical and User-Messages
  • Controlled Exceptions
  1. Implementation Patterns
  2. Exception Handling

Exception Handling Pattern

Get your hands on it

Last updated 6 months ago

Basically, there are two different types of exceptions:

  1. Uncontrolled exceptions (Exception)

    Thrown, for example, by a connector where you have no control over the message or format of that exception. For example, connection time-out.

  2. Controlled exceptions (ApplicationException)

    Thrown by your code - controlled exception.

Uncontrolled Exceptions

Uncontrolled exceptions are thrown by the platform or a connector and there is not much you can do. In your Catch-Block you get a Try/Catch Message and you have to deal with it.

Technical and User-Messages

Uncontrolled exceptions normally contain (English) technical messages that generally cannot or must not be passed on to the user. We refer to such messages below as the rootCause of the exception. The root-cause of an exception is only stored internally by Boomi, for example in the log.

A (localised) error message for the user, which we refer to as a userMessage, could be: "An error has occurred. Please contact your admin".

  • rootCauseis the technical error message that is not shown to the user.

  • userMessage is a (localised) message to the user.

Controlled Exceptions

The idea of retaining control over exceptions is to give the exception message some (Json) structure. With structured exception messages, we are able to react specifically to the various exceptions in the catch block. Controlled exceptions are thrown by your code (Exception Shape), and you can decide what to put in the exception message.

Let's look a bit closer at user-defined exception messages.

Try/Catch Message