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 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

Related Questions

I'm on the look out for a Cor C++ library / SDK that will
Does anyone have any tips or gotcha moments to look out for when trying
I may have strings that will look something like this: ABC DEF-123 456 789GH-IJK-0
I’ve had a good look and can’t seem to find out how to select
I was taking a look at http://www.zenfolio.com/zf/features.aspx and I can't figure out how they
I generally use a manual process: Look at the page, figure out the semantic
All you ios architects out there, please help me choose architecture/technology for the following
I have a table (id=docsTable) whose rows look similar to this: <tr bgcolor=#E7DDCC> <td
I'm new to ASP, VBScript and am trying to figure out how to change
Look at this image: alt text http://img139.imageshack.us/img139/4488/picture2ep3.png I know how to add UITableView with

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.