SlideShare a Scribd company logo
1
November 12, 2022
Mysore MuleSoft Meetup
Error Handling in Mule 4
Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only. We are
not representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any
responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
3
A recording of this meetup will be uploaded to events page within 24 hours.
Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab.
Make it more Interactive!!!
Give us feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks!!! Its Bread & Butter for Meetup.
Housekeeping
4
Introduction
● About the Organizers
5
Shubham Chaurasia
Billennium India
Professional Integration Developer
A SHOW OF HANDS:
Who is new to this Meetup?
Giridhar Meka
Sr. Technical Architect
 Certified MuleSoft Developer
 2+ years of Total Experience, 1.5+ years in MuleSoft
 Working as Software Engineer at HashedIn By Deloitte
● About the Speaker
Speaker
6
Abhishek Goel
Software Engineer
7
● Introduction
○ What are Errors & Error Types?
○ Components of a Mule Error
○ Creating Custom Errors
○ On-Error Components
○ Handling Errors at different levels
○ Performing different Actions with different Errors
● Demo
● Trivia
● Wrap-Up
Agenda
In Mule, errors are a way of communicating that something went wrong and providing meaningful
information so that a user can take corrective action depending on the kind of error that was thrown.
Errors
8
Types of Mule Errors
 System Errors:
Mule throws a system error when an exception occurs at the system level and no Mule event is involved.
A system error handler manages exceptions that occur:
1. During application startup.
2. When a connection to an external system fails.
 Messaging Errors:
Mule throws a messaging error (a Mule error) whenever a problem occurs within a flow of a Mule app,
where Mule events and the messages they contain are processed.
Components of Mule Message Error
9
• Mule errors have a namespace and Identifier and they belong to a hierarchy of error types which enables
distinguishing of errors. For ex: HTTP: NOT_FOUND, FILE:NOT_FOUND enables developer to identify
which connector is throwing the error.
• Error types can have a parent type. This hierarchy implies that each error type is a specification of more
global error type. The hierarchies enable you to route errors in a general or more specific way. For ex: The
parent of HTTP: UNAUTHORIZED is MULE:CLIENT_SECURITY and parent of
MULE:CLIENT_SECURITY is MULE:SECURITY.
• All errors that can be handled come under ANY.
Error Hierarchy and Types
10
This is used to define namespaces that are related to the particular Mule app name or context and avoid using
existing connector namespaces.
Custom Errors are used to make error messages more informative. For ex: Mapping an error occurring in
customer app can be mapped with Customer namespace and order app can be mapped with Order namespace.
Custom Errors
11
Messaging errors can be handled mainly through 4 ways:
1. Default Error Handler: By default, unhandled messaging errors are logged and propagated. When a flow is
processing a Mule message that raises an error, the normal execution of the flow stops, and the process
transfers to the flow’s default error handler, which propagates the error.
Handling Errors
12
Handling Errors
2. Global Level Error Handling: An Error Handler flow can be designed and
referenced from other flows or try blocks. A reusable configuration can be
made to define a general error handling technique of the application. For ex:
If the application is supposed to notify the stakeholders as soon as an error
scenario arises in the application, then a global error handler can be designed
and referenced.
13
Handling Errors
3. Flow Level Error Handling: On error components (On Error Continue and On Error Propagate) can be
used inside a built-in or external Error Handler component. Flow level error handling is preferred when you
want to handle cases that are specific to the flow.
14
4. Component Level Error Handling: Components can be enclosed inside a try block which
has an in-built error handler. This is generally used when the application is trying to connect
with any external system or inside a sub-flow which does not have it’s own error handler.
15
On-Errors Components
On-Error components differ in the way they affect their owner, that is, the Flow or Try scope where they are defined.
On-error Propagate: Executes but propagates the error to a higher level, such as a containing scope (for example, to a
Flow that contains a Try scope where the error occurs) or external flow containing a Flow Reference to the flow in which an
error occurs. The error breaks the owner’s execution and propagates to that higher level, causing a failure at that level. In
addition, any transaction the owner handles is rolled back.
On-Error Continue: Executes and uses the result of the execution as the result of its owner, as if the owner
completed the execution successfully. Any transaction the owner handles is committed. However, note that
the transaction is not committed if another component (one that does not own On Error Continue) created the
transaction.
On Error Components
16
17
On Error Components
Demo
Q&A
Take a stand !
20
● Nominate yourself for the next meetup speaker and suggest a topic as well.
21
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Join Mysore Group: https://meetups.mulesoft.com/mysore/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
○ Reach out to Mysore Meetup Leaders (Shubham / Giridhar) to suggest
topics for next Meetup
What’s next?
Get ready to WIN a MuleSoft Voucher from MuleSoft
Quiz Time
Thank you

More Related Content

PDF
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
PPTX
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
PPTX
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
PPTX
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
PPTX
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
PPTX
Virtual MuleSoft Meetup may_2020
PPTX
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
PPTX
Online Spanish meetup #1
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Exception handling in Mule 4 _Virtual mule soft meetup may_2020
Virtual MuleSoft Meetup may_2020
Indore MuleSoft Meetup #4 : Demystifying Error Handling & Snowflake Integration
Online Spanish meetup #1

Similar to Error Handling In Mule 4 | MuleSoft Mysore Meetup #10 (20)

PPTX
Mulesoft meetup slides mumbai_20113019_exception_handling
PPTX
Mule soft meetup__dubai_12_june- Error Handling
PPTX
Coimbatore Second Mule Meetup on Error Handling in Mule 4
PPTX
Coimbatore meetup error handling 24apr2021
PDF
Virtual Meetup: Mule 4 Error Handling and Logging
PPTX
Vancouver mulesoft meetup_23-july
PPTX
Mule meetup Hyderabad
PPT
Error Handling in Mulesoft
PPTX
Global Exception Handling Custom Error Connector In MuleSoft
PDF
MuleSoft Surat Meetup#47 - Error Handling With MuleSoft
PPTX
Error handling
PPTX
Elements in a muleflow
PPTX
Elements in a mule flow
PPTX
Mule error handling
PPTX
A short introduction on error handling in anypoint studio
PPTX
Mule - error handling
PPTX
Error handling with respect to mule
PPTX
Mule exception strategies
PPTX
Mule exceptions Strategy
PPTX
Delhi MuleSoft Meetup - 19 march2022
Mulesoft meetup slides mumbai_20113019_exception_handling
Mule soft meetup__dubai_12_june- Error Handling
Coimbatore Second Mule Meetup on Error Handling in Mule 4
Coimbatore meetup error handling 24apr2021
Virtual Meetup: Mule 4 Error Handling and Logging
Vancouver mulesoft meetup_23-july
Mule meetup Hyderabad
Error Handling in Mulesoft
Global Exception Handling Custom Error Connector In MuleSoft
MuleSoft Surat Meetup#47 - Error Handling With MuleSoft
Error handling
Elements in a muleflow
Elements in a mule flow
Mule error handling
A short introduction on error handling in anypoint studio
Mule - error handling
Error handling with respect to mule
Mule exception strategies
Mule exceptions Strategy
Delhi MuleSoft Meetup - 19 march2022
Ad

More from MysoreMuleSoftMeetup (20)

PPTX
MuleSoft for Agentforce: Unlocking API Catalog & Topic Center | Get Started w...
PPTX
Revolutionizing Serverless Computing with MuleSoft: AWS Lambda & S3 Integration
PPTX
Revolutionizing Serverless Computing with MuleSoft: AWS Lambda & S3 Integrati...
PPTX
MuleSoft + AI + IDP + ACB | MuleSoft Mysore Meetup #50
PPTX
[Part-1] Automating MuleSoft Deployment with Github Actions | MuleSoft Mysore...
PPTX
Configuring Single Sign-On (SSO) via Identity Management | MuleSoft Mysore Me...
PPTX
Mule event processing models | MuleSoft Mysore Meetup #47
PPTX
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
PPTX
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
PPTX
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
PPTX
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
PPTX
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
PPTX
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
PPTX
State Management in Mule applications | MuleSoft Mysore Meetup #42
PPTX
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
PPTX
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
PPTX
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
PPTX
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
PPTX
Azure DevOps Pipeline setup for Mule APIs #36
PPTX
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
MuleSoft for Agentforce: Unlocking API Catalog & Topic Center | Get Started w...
Revolutionizing Serverless Computing with MuleSoft: AWS Lambda & S3 Integration
Revolutionizing Serverless Computing with MuleSoft: AWS Lambda & S3 Integrati...
MuleSoft + AI + IDP + ACB | MuleSoft Mysore Meetup #50
[Part-1] Automating MuleSoft Deployment with Github Actions | MuleSoft Mysore...
Configuring Single Sign-On (SSO) via Identity Management | MuleSoft Mysore Me...
Mule event processing models | MuleSoft Mysore Meetup #47
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
State Management in Mule applications | MuleSoft Mysore Meetup #42
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Azure DevOps Pipeline setup for Mule APIs #36
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Ad

Recently uploaded (20)

PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Pre independence Education in Inndia.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Institutional Correction lecture only . . .
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Types and Its function , kingdom of life
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Complications of Minimal Access Surgery at WLH
Module 4: Burden of Disease Tutorial Slides S2 2025
Insiders guide to clinical Medicine.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Pre independence Education in Inndia.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
TR - Agricultural Crops Production NC III.pdf
VCE English Exam - Section C Student Revision Booklet
Institutional Correction lecture only . . .
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharma ospi slides which help in ospi learning
Cell Types and Its function , kingdom of life
Microbial disease of the cardiovascular and lymphatic systems
O5-L3 Freight Transport Ops (International) V1.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O7-L3 Supply Chain Operations - ICLT Program
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Supply Chain Operations Speaking Notes -ICLT Program
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Complications of Minimal Access Surgery at WLH

Error Handling In Mule 4 | MuleSoft Mysore Meetup #10

  • 1. 1
  • 2. November 12, 2022 Mysore MuleSoft Meetup Error Handling in Mule 4
  • 3. Safe Harbour Statement ● Both the speaker and the host are organizing this meet-up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements. ● This presentation is not meant for any promotional activities. 3
  • 4. A recording of this meetup will be uploaded to events page within 24 hours. Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab. Make it more Interactive!!! Give us feedback! Rate this meetup session by filling feedback form at the end of the day. We Love Feedbacks!!! Its Bread & Butter for Meetup. Housekeeping 4
  • 5. Introduction ● About the Organizers 5 Shubham Chaurasia Billennium India Professional Integration Developer A SHOW OF HANDS: Who is new to this Meetup? Giridhar Meka Sr. Technical Architect
  • 6.  Certified MuleSoft Developer  2+ years of Total Experience, 1.5+ years in MuleSoft  Working as Software Engineer at HashedIn By Deloitte ● About the Speaker Speaker 6 Abhishek Goel Software Engineer
  • 7. 7 ● Introduction ○ What are Errors & Error Types? ○ Components of a Mule Error ○ Creating Custom Errors ○ On-Error Components ○ Handling Errors at different levels ○ Performing different Actions with different Errors ● Demo ● Trivia ● Wrap-Up Agenda
  • 8. In Mule, errors are a way of communicating that something went wrong and providing meaningful information so that a user can take corrective action depending on the kind of error that was thrown. Errors 8 Types of Mule Errors  System Errors: Mule throws a system error when an exception occurs at the system level and no Mule event is involved. A system error handler manages exceptions that occur: 1. During application startup. 2. When a connection to an external system fails.  Messaging Errors: Mule throws a messaging error (a Mule error) whenever a problem occurs within a flow of a Mule app, where Mule events and the messages they contain are processed.
  • 9. Components of Mule Message Error 9
  • 10. • Mule errors have a namespace and Identifier and they belong to a hierarchy of error types which enables distinguishing of errors. For ex: HTTP: NOT_FOUND, FILE:NOT_FOUND enables developer to identify which connector is throwing the error. • Error types can have a parent type. This hierarchy implies that each error type is a specification of more global error type. The hierarchies enable you to route errors in a general or more specific way. For ex: The parent of HTTP: UNAUTHORIZED is MULE:CLIENT_SECURITY and parent of MULE:CLIENT_SECURITY is MULE:SECURITY. • All errors that can be handled come under ANY. Error Hierarchy and Types 10
  • 11. This is used to define namespaces that are related to the particular Mule app name or context and avoid using existing connector namespaces. Custom Errors are used to make error messages more informative. For ex: Mapping an error occurring in customer app can be mapped with Customer namespace and order app can be mapped with Order namespace. Custom Errors 11
  • 12. Messaging errors can be handled mainly through 4 ways: 1. Default Error Handler: By default, unhandled messaging errors are logged and propagated. When a flow is processing a Mule message that raises an error, the normal execution of the flow stops, and the process transfers to the flow’s default error handler, which propagates the error. Handling Errors 12
  • 13. Handling Errors 2. Global Level Error Handling: An Error Handler flow can be designed and referenced from other flows or try blocks. A reusable configuration can be made to define a general error handling technique of the application. For ex: If the application is supposed to notify the stakeholders as soon as an error scenario arises in the application, then a global error handler can be designed and referenced. 13
  • 14. Handling Errors 3. Flow Level Error Handling: On error components (On Error Continue and On Error Propagate) can be used inside a built-in or external Error Handler component. Flow level error handling is preferred when you want to handle cases that are specific to the flow. 14 4. Component Level Error Handling: Components can be enclosed inside a try block which has an in-built error handler. This is generally used when the application is trying to connect with any external system or inside a sub-flow which does not have it’s own error handler.
  • 15. 15 On-Errors Components On-Error components differ in the way they affect their owner, that is, the Flow or Try scope where they are defined. On-error Propagate: Executes but propagates the error to a higher level, such as a containing scope (for example, to a Flow that contains a Try scope where the error occurs) or external flow containing a Flow Reference to the flow in which an error occurs. The error breaks the owner’s execution and propagates to that higher level, causing a failure at that level. In addition, any transaction the owner handles is rolled back.
  • 16. On-Error Continue: Executes and uses the result of the execution as the result of its owner, as if the owner completed the execution successfully. Any transaction the owner handles is committed. However, note that the transaction is not committed if another component (one that does not own On Error Continue) created the transaction. On Error Components 16
  • 18. Demo
  • 19. Q&A
  • 20. Take a stand ! 20 ● Nominate yourself for the next meetup speaker and suggest a topic as well.
  • 21. 21 ● Share: ○ Tweet using the hashtag #MuleSoftMeetups ○ Join Mysore Group: https://meetups.mulesoft.com/mysore/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program ○ Reach out to Mysore Meetup Leaders (Shubham / Giridhar) to suggest topics for next Meetup What’s next?
  • 22. Get ready to WIN a MuleSoft Voucher from MuleSoft Quiz Time