Handle exceptions when Dal calls sp

Source: Internet
Author: User

Three scenarios:

1. An error occurred while executing sp. For example, the connection is abnormal and the database permission is abnormal.

2. SPCodeThrow an exception

3. the return value/output parameter value does not comply with the conventions.

In the latter two cases, you need to record the parameter values of the input SP when an exception occurs. The business logic layer needs to capture and re-throw to ensure that the UI Layer provides user-friendly error prompts.

In the first case, there is no need to intervene in the middle layer. The UI displays error codes or fuzzy error messages, such as the system is busy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.