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 1099573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:45:16+00:00 2026-05-17T00:45:16+00:00

I have the following Action Method: [HandleFtmsError] public ActionResult PerformanceChart(ChartViewModel chart) { var x

  • 0

I have the following Action Method:

    [HandleFtmsError]
    public ActionResult PerformanceChart(ChartViewModel chart)
    {
        var x = 1;
        var y = 0;
        var z = x/y;
        return Json("");
    }

where HaneleFtmsError is defined as:

public class HandleFtmsErrorAttribute : System.Web.Mvc.HandleErrorAttribute
{
    public override void OnException(ExceptionContext context)
    {
        base.OnException(context);
        if (context.ExceptionHandled)
            RaiseErrorSignal(context.Exception);
    }

    private static void RaiseErrorSignal(Exception e)
    {
        var context = HttpContext.Current;
        ErrorSignal.FromContext(context).Raise(e, context);
    }
}

I thought that attribute over the action method would have been executed with a DivideByZero exception, but it’s not working. All I’m seeing is the code breaks on the line where I’m doing the division. Am I doing something wrong?

  • 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-17T00:45:17+00:00Added an answer on May 17, 2026 at 12:45 am

    When you say “the code breaks” do you mean it’s breaking into the debugger? That’s probably just the standard debugger behaviour, which you can change via the Debug menu’s “Exceptions…” item. If you hit F5 again – or run without debugging – you may see the behaviour you expect.

    MVC isn’t preventing the exception from being thrown (which is what the debugger’s looking for) – it’s just handling the exception by noticing the attribute on the controller and passing the information on appropriately. At the point where the debugger’s breaking in, there hasn’t been a chance for it to do that yet.

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

Sidebar

Related Questions

I have the following Action method. public ActionResult Action() { var model = new
i have the following action method that calls a repository method:- public ActionResult Details(int
I have the following DeletePOST action method:- [HttpPost] public ActionResult Delete(int id) { try
I have the following action method in my Tournament controller: public ActionResult Edit(int id)
I have the following action methods: public ActionResult ProfileSettings() { Context con = new
I have the following code in my post action method for Edit. JobCardService.Update(viewData.JobCard); var
I have the following action method that initiated SelectList as follow:- public PartialViewResult Search(string
I have an action method in my UpdatesController with the following signature: public JsonResult
I have the following method public ActionResult Search(FormCollection form) { ....... Publication[] publicationsResult =
i have the following data as a string in my Action method: string json

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.