业务逻辑层中的异常处理? [英] exception handling in businesslogic layer?

查看:149
本文介绍了业务逻辑层中的异常处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个查询,例如在catch块的业务逻辑层中,我想创建用于处理异常的日志文件,在UI层中,我想重定向到error.aspx页面.该怎么做?

问候
Rama

Hi all,

I have one query like in business logic layer of catch block i want to create log file for handling the exceptions and in UI layer i want to redirect to error.aspx page . how to do that ?

Regards
Rama

推荐答案

嗯,可以有多种方法.为了使事情变得简单,只需将错误从业务层上移到UI层上即可.在UI中捕获它,并使用任何第3方(例如log4net)或直接将其记录在普通文本文件中.

让ASP.NET web.config处理重定向

有一个HttpModule来跟踪错误,记录错误并重定向.

立即尝试!
Well there can be various ways. For you to keep things simple, just throw the error up from Business layer to UI layer. Catch it in UI and log it using any 3rd party like log4net or directly in a normal text file.

Let the ASP.NET web.config handle the re-direction
OR
Have a HttpModule in place to trace the errors, log it and redirect.

Try now!


这篇关于业务逻辑层中的异常处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆