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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:25:17+00:00 2026-05-28T08:25:17+00:00

So this is a follow-up to a previous question that I asked: Trying to

  • 0

So this is a follow-up to a previous question that I asked: Trying to figure out if this code creates any benefit by using a Singleton

In a nutshell, I have inherited a poorly architected program that uses a pseudo-facade class and places it into a Singelton. Every method call goes through the Singleton which then calls different methods.

The Singelton looks like this:

public class FooFacade
{
    private static FooFacade m_facade = null;
    private static DataAccessManager m_dataAccessMgr = null;

    public StringBuilder Status {get; set; }

    private FooFacade()
    {
        this.Status = new StringBuilder();
    }

    public static FooFacade getInstance()
    {
        if (m_facade == null)
        {
            m_dataAccessMgr = DataAccessManager.getInstance();
            m_facade = new FooFacade();
        }

        return m_facade;
    }

    public void clearStatus()
    {
        this.Status.Remove(0, Status.Length);
    }

    public void Method1(string value1, int value2)
    {
        // do something
    }


    public int Method2(int value1, int value2)
    {
        return externalMethod(value1, value2)
    }
}

So in this example above, would there be a security concern if the externalMethod that is being called in Method2 threw an error?

For example:

public int externalMethod(value1, value2)
{
    try
    {
        return value1/value2;
    }
    catch
    {
        throw;
    }
}

In this method, should I be concerned that a Singleton could display a thrown error to the wrong user?

When I have the chance to refactor, I’m getting rid of the Singleton, but in the meantime, I just don’t want to accidentally add a huge security hole by adding better exception handling.

-Chad

  • 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-28T08:25:17+00:00Added an answer on May 28, 2026 at 8:25 am

    There is no way that the exception thrown is displayed to another “user”. The exception is thrown in the call stack of the current call, so if two different threads were to call Method2 and in thread A the external method throws an exception and in thread B it doesn’t, than only thread A would receive the exception.

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

Sidebar

Related Questions

This is a follow up question to a previous question I asked about calculating
This is a follow up from my previous question I have this code basically
This is a follow up to my previous question . My code is still
This is a follow up to my previous question . Consider that I write
This is a follow up to a previous question that I had before about
This is a follow up question to my previous question . I am trying
This is a follow up to a previous question I asked How to encode
This is a follow up to my previous question . I am using the
This is a follow up question to my previous question . I am trying
This question is an follow-up of an previous asked question . I've written an

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.