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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:33:38+00:00 2026-06-01T09:33:38+00:00

We use ELMAH for our ASP.NET web app and I am stumped as to

  • 0

We use ELMAH for our ASP.NET web app and I am stumped as to some of the exceptions we get. Some of these are:

  • System.FormatException: Invalid length for a Base-64 char array.
  • System.Web.HttpException: Unable to validate data.
  • System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.

I simply have no idea why they occur, but the end user apparently does not see them, so I want to ignore them and supress the emails. If I do this, I want to make sure that System.FormatException only uses Invalid length for a Base-64 char array. for its message text and not also some other message. If it did and I ignored it, I might be missing out on other exceptions that are thrown under System.FormatException. If that is the case, I’d have to check for the message text. That’s not a problem, but I really don’t like hardcoding strings in my app.

Update:

I tried this code:

        try
        {
            throw new System.FormatException();
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }

        Console.Read();

And its message text is:

One of the identified items was in an invalid format.

This tells that the answerer is right and that exceptions should be ignored based on both exception and message text.

  • 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-06-01T09:33:39+00:00Added an answer on June 1, 2026 at 9:33 am

    The exception’s Message property is not useful to help you diagnose bugs in your code or problems with the user’s configuration. This is also why you don’t know why they occur. You must put more information in your email, particularly the exception’s StackTrace property is crucial to help you find out exactly where the exception occurred. If an exception has an InnerException then you always need to know that one as well since it is typically the core reason another exception got triggered.

    Simply use the exception’s ToString() method to generate a better diagnostic to put in your email message.

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

Sidebar

Related Questions

We're using ELMAH for error logging in our ASP.NET application. We use the SQL
I try to use ELMAH on my ASP.NET MVC2 application, it works fine on
I have created a website using ASP.NET MVC and use ELMAH for error handling,
I want to use ELMAH with sql server on my ASP.net MVC 3 project,
The application includes: ASP .NET MVC web app DAL Background Service Library project The
I am trying to get an ASP.Net MVC2 app to display a simple custom
I've tried to use elmah with my asp.net site but whenever I try to
I can wire up Elmah to log Exceptions in my ASP.Net application and it
I use asp.net c# using Web Forms. I use Routing for my website. I
Occasoinally i get this exception thrown (viewable in elmah) System.Web.HttpException: Server cannot append header

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.