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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:33:21+00:00 2026-06-13T10:33:21+00:00

Question 1 – practical I run child process in my C# application using System.Diagnostics.Process

  • 0

Question 1 – practical

I run child process in my C# application using System.Diagnostics.Process. Like the following:

Process process = new Process();

// ... StartInfo initialization here

int timelimit_ms = 30000;
process.Start();
if (!process.WaitForExit(timelimit_ms))
{
  // What exception to throw here?
  throw new Excpetion(
    "An executing method exceeded the time limit of " + timelimit_ms.ToString() + "ms");
}

I’m currently throwing System.ComponentModel.Win32Exception. But I don’t sure it is the best choice. The child process is a simple command line utility. So the first question, what exception to throw in this situation?

Question 2 – thoretical

This is not the first time I ask myself about what exception to throw. And I don’t know of a simple guidelines on how to pick a certain one. There are so much exceptions in C#, deeply inherited from one namespace to another. The second question, how to decide what exception to throw in a specific situation?

  • 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-13T10:33:23+00:00Added an answer on June 13, 2026 at 10:33 am

    Practically, I’d throw a TimeoutException as it describes what is happening

    Theoretically, if a quick google / read of the docs doesn’t throw up an exception that already describes what is happening then you can just extend Exception to generate a WeirdThingThatHappensSometimesInMyApplication Exception.

    But it depends who or what is going to “read” your exception. If your exception isn’t exceptional then maybe you should do things differently 🙂

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

Sidebar

Related Questions

Question: Is it possible to cluster an application which is using Socket.io for WebSocket
Question when running the following code: X509Certificate2 cert = new X509Certificate2(@C:\file.p12, password, X509KeyStorageFlags.Exportable); RSACryptoServiceProvider
Question I'd like the CSS background texture for my content area to begin immediately
Question: I receive the following error for the code below, does anyone know why?
Question We're developing a custom EventEmitter inspired message system in Objective-C. For listeners to
Question 1: I've tried the following to detect characters (uppercase and lowercase), numbers and
Question: How can I give a new user almost all privileges, but still keep
Question for the video tag, the following code works for every browsers expect opera
Question i asked earlier along the same lines - jQuery - Selecting a child
Question Can I build a image database/library that has an e-commerce style checkout system

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.