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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:24:57+00:00 2026-05-14T19:24:57+00:00

I recently migrated a VB6 app to VB.Net. Entire VB6 dependency are removed .

  • 0

I recently migrated a VB6 app to VB.Net. Entire VB6 dependency are removed . And the code was working fine just for a single module mean to say like for WinApp it is working fine.

Now my requirement has been changed, now the same class will be accessed by multiple application , it might a Windows App, Web App or a web service. So I am not able decide any efficient error handling pattern.

So you you guys help me out. Currently what I am doing is that parent function , i am passing two vars LogError as bool and ErrorMessage as string parameter, that will further check something like this

Catch(ex as Exception)
     If LogError then
          MessageBox.Show("My_Module_Name :" & ex.Message)
     EndIf
     ErrorMessage = ex.Message
End Try

Also same catch block is used in all other functions/ subroutines.
So what I need is any elegant handling method that will work efficiently on cross-app platform(win/web/service)

  • 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-14T19:24:57+00:00Added an answer on May 14, 2026 at 7:24 pm

    I’d suggest logging the messages, either to a log file or to the Event log, but why not let the clients choose, in that you could add some methods to let the client decide where it should be logged. Though instead of having your exception handler handle the message and put it into an errormessage variable I’d just follow the logging with a throw so that the Exception continued up in the call chain until some code that knew how to handle it got it.

    In general it’s not good practice to catch Exception, you should catch only the exceptions that you can handle. But I think it’s ok if you just want to log it and then will re-throw it again.

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

Sidebar

Related Questions

I recently migrated my magento website to a different server, and here's the process
I've been building an app recently that has a model Books that is a
Recently I had to type up some documentation on .net data providers and ado.net.
I have a emacs mode hook code (defun php-mode-hook () (setq tab-width 4 c-basic-offset
I've recently inherited a medium-sized php site which is horribly coded. It violates every
Recently, I read this article: http://download.oracle.com/javase/tutorial/extra/generics/wildcards.html My question is, instead of creating a method
Recently i've switched to PHP 5.3+ and after that migration i learned that the
recently I've installed the FireGestures plugin for Firefox, which I find very useful. You
I have the following web service method (.ASMX file): [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat =
There is a blog , powered by Wordpress, which has valid RSS feed (opens

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.