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

  • Home
  • SEARCH
  • 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 580647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:29:41+00:00 2026-05-13T14:29:41+00:00

I am on the look out for an accepted solution for trapping errors in

  • 0

I am on the look out for an accepted solution for trapping errors in the following scenario:
i have an asp.net web services that interacts with the database. I interact with the web service through jquery’s $ajax function.

I would like to know what is the accepted stable methodology for error trapping. When the data is received from the the web service there are two types of errors in my scenario:

  • db errors
  • ajax errors

Ajax errors can trapped inside error portion of $ajax function. I trap the database errors inside the web service and so far I could only come up with one idea how to pass them on to the user – pack them in the results array. But this solution is awkward. Are there any better ideas?

Here is the sample of code I use for accessing asp.net web service:

$.ajax({
  type: "POST",
  url: "http://localhost/WebServices/Service.asmx/GetBillingEntities",
  data: "{}",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function(response) {
    var results = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;

    DisplayResults();
  },

  error: function(xhr, status, error) {
    // Display a generic error for now.
    alert("AJAX Error!");
  }
});

So should the database results go in to results array and unpacked there manually? Is there a better system?
Thanks!

  • 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-13T14:29:42+00:00Added an answer on May 13, 2026 at 2:29 pm

    What you can do is throw an exception in your GetBillingEntities method of your webservice. Catch the exception, log some details and then re-throw it. If your method throws an exception it should get caught in the “error:” block.

    So basically you handle the error data in your service and handle how to display an error to the user in your “error:” block.

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

Sidebar

Ask A Question

Stats

  • Questions 295k
  • Answers 295k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To parse dates with non-standard abbreviations, you'll need to create… May 13, 2026 at 6:52 pm
  • Editorial Team
    Editorial Team added an answer Why after_save and not before_create and let ActiveRecord worry about… May 13, 2026 at 6:52 pm
  • Editorial Team
    Editorial Team added an answer Try putting white-space:nowrap; in your <ul> style edit: and use… May 13, 2026 at 6:52 pm

Related Questions

I am a quite happy user of Eclipse (I mostly develop in PHP and
I've made this Community Wiki because some may think it's open to debate and
I'm studying Computer Graphics as part of my curriculum at my university. The course
I am attempting to recover source from an assembly using Reg Gate's Reflector. The
Hi friends hope all r doing well. I have a problem while reading xml

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.