Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6138487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:52:29+00:00 2026-05-23T17:52:29+00:00

Probably a stupid question… but here goes anyway… I have set up quartz, and

  • 0

Probably a stupid question… but here goes anyway…

I have set up quartz, and can schedule jobs, and I can confirm that jobs (implementing the IJob interface) are working.

Looking at the documentation on the site, (Lesson 3 of the tutorial):

The only type of exception that you are allowed to throw from the execute method is JobExecutionException.

I would like that when an exception occurs that I haven’t explicitly handled, it should throw a JobExecutionException, so that I can log it in the ‘parent’ application. I have wrapped my code in a try catch, and have thrown the JobExecutionException, but now where to handle it?

I don’t call the execute method anywhere, that is handled by Quartz (on a separate thread). So, how do I handle that error when it occurs. I don’t really want to swallow the error in the Job

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:52:30+00:00Added an answer on May 23, 2026 at 5:52 pm

    Typically you would set up the execute method of your job as follows:

    try
    {
        // the work you want to do goes here
    }
    catch (ExceptionTypeYouWantToHandle1 ex1)
    {
        // handle exception
    }
    catch (ExceptionTypeYouWantToHandle2 ex2)
    {
        // handle exception
    }
    // and so on
    catch (Exception ex)
    {
        // something really unexpected happened, so give up
        throw new JobExecutionException("Something awful happened", ex, false); // or set to true if you want to refire
    }
    

    At this point the scheduler itself will log the exception to wherever it is logging (based on the configuration).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Probably a stupid question, but here goes. In my view, I have the following
I have probably stupid question but how Can I create Many-To-Many relationship with create
Probably a stupid question but so far I can't figure this out... I have
This is probably a stupid question but will ask anyway sine I have no
This is probably a stupid question but anyway. I wan the number I set
I feel like this is probably a stupid question... but anyway I have this
I have a simple and probably stupid question, but I can't really find any
this is probably a stupid question but I can't seem to find the answer.
This is probably a stupid question, but I have to ask. I found this
This is probably a stupid question, but I can't seem to do it. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.