Refactor Code

  • Gravatar
    Displaying the higher level error message to the user

    by azamsharp on 5/8/2008 9:35:38 AM
  • Error messages must be meaningful but does that mean that we must show every error message to the user. I think the error message should be related to the UI the user is working on. Like if he is grading an exam (suppose) then the error message should be about grading the exam. If the grading module throws divide by zero exception even then the message on the screen should say something "Grading failed!".
  • try
    {
    GradeExam(exam);
    }
    catch(Exception ex)
    {
    message = "Grading failed!!";
    }

    CreateExam(exam)
    {
    DoSomething(exam);
    }


    DoSomething(exam) { // divide by zero exception thrown }
  • Refactor it!
  • Gravatar
    sdf
    by sss on 5/15/2008 11:30:16 AM
  • sdfsdf
Please log in to refactor the code! Login