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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:12:04+00:00 2026-05-13T14:12:04+00:00

How should a program handle errors? Example: A program needs the file text.txt .

  • 0

How should a program handle errors? Example:

A program needs the file text.txt. It must exist and be writable. What should it do if it’s not writable or doesn’t exist? Should it try to chown/chmod the file? Should it try to create it or just display an error message?

Or: Should it try to find a solution or just display an error message?

  • 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-13T14:12:04+00:00Added an answer on May 13, 2026 at 2:12 pm

    It’s up to you how to handle it. You have to define your scenarios, user interactions, and other parts of the program. Once you define those it is time to implement and test those scenarios.

    Some questions to ask:

    • What data is being written to the file?
    • How critical is it that the data get saved?
    • If an error is reported, who will see the error?
    • If an error is reported, how do you expect a user to react? And what are their options?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to handle all internal errors gracefully, without program termination. As discussed here
my program should print a message on the screen if the formula that the
This program should calculate the value of 2^1+2^2 + ... + 2^10: #include <stdio.h>
What the program should do: After the user clicks the delete button with a
here is how should my program be. In first frame, there is a textfield1
The following line in my C program should provided All/Group/Owner read and write permissions
The assignment at my first year uni computing course says my program should read
If a user types in [[0,0,0], [0,0,1], [1,1,0]] and press enter, the program should
I have this program that should execute a piece of code base on the
Im writing a program that should read input via stdin, so I have the

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.