09-12-2013
It is good practice to distinguish between errors and warnings.
Errors are situations where - even if the program manages to continue - the results are unreliable if not unusable. You need to have a method of alerting the user or developer that something is wrong and needs to be fixed.
Warnings are situations that the user needs to be alerted to, but may not be detrimental to the quality of the output.
I think you will want to design your program around a definition of what constitutes an error and what a warning.
This User Gave Thanks to figaro For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
$ errpt | more
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR
B8113DD1 ... (0 Replies)
Discussion started by: mcastill66
0 Replies
2. AIX
$ errpt | more
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
B8113DD1 0802050205 T H fcs1 LINK ERROR
3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR
B8113DD1 ... (2 Replies)
Discussion started by: mcastill66
2 Replies
3. UNIX for Dummies Questions & Answers
Hi all, dummy here.... I have major errors on entering the shell. On login I get:
-bash: dircolors: command not found
-bash: tr: command not found
-bash: fgrep: command not found
-bash: grep: command not found
-bash: grep: command not found
-bash: id: command not found
-bash: [: =: unary... (12 Replies)
Discussion started by: wcmmlynn
12 Replies
4. UNIX for Dummies Questions & Answers
while entering into vim insert mode some garbage is getting printed in to the file
could some one help to avoid this . (1 Reply)
Discussion started by: Gopi Krishna P
1 Replies
5. Shell Programming and Scripting
Is there a way to do this?
while getopts "n:g:m:i:p:d:a:" OPTION
do
case $OPTION in
...
if i do a ./script.sh -n john -u user -p password, it will output:
name= john
./script.sh: illegal option -- u
Is there a way to skip over errors so that -p will get processed as well?
By... (7 Replies)
Discussion started by: etranman1
7 Replies
6. Shell Programming and Scripting
Mysql log has something like below:
I need a bash shell script that will do the following:
1) The script will scan the mysql.log file constantly in real time (something like tail -F mysql.log)
2) If it encounters 5 consecutive identical lines then it would invoke some commands (say... (4 Replies)
Discussion started by: proactiveaditya
4 Replies
7. Ubuntu
Hi folks,
Ubuntu 9.04
I have an old box not running for years. I just dig it out from the store room. On running;
$ sudo aptitude update
......
......
Err http://hk.archive.ubuntu.com jaunty/main Packages
404 Not Found
Err http://hk.archive.ubuntu.com jaunty/restricted Packages
... (1 Reply)
Discussion started by: satimis
1 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am trying to convert a C language program over to Sparc Assembley and I am getting Undefined first referenced... (4 Replies)
Discussion started by: kenjiro310
4 Replies
9. Programming
co
#! /usr/bin/perl
use strict;
use warnings;
use diagnostics;
my $amount=""; my $bain; ; my $code="";
my $date;my $day;my $line; my $mo; my $LNUM = 0;
my $xyz=""; my $yr;
$yr = 2015;
my $F; my @F;
while (<>) {
chop;
++$LNUM;
@F = split(';');
if ( $F eq "Date" )... (1 Reply)
Discussion started by: hpk
1 Replies
10. Shell Programming and Scripting
I need to split a file based on headers found
Input file
file1 content:
ADD
john
mickey
DROP
matt
sam
output of file F1
john
mickey
output of file F2
matt
sam (5 Replies)
Discussion started by: Diddy
5 Replies
LEARN ABOUT DEBIAN
test::http::server::simple::stashwarnings
Test::HTTP::Server::Simple::StashWarnings(3pm) User Contributed Perl Documentation Test::HTTP::Server::Simple::StashWarnings(3pm)
NAME
Test::HTTP::Server::Simple::StashWarnings - catch your forked server's warnings
SYNOPSIS
package My::Webserver::Test;
use base qw/Test::HTTP::Server::Simple::StashWarnings My::Webserver/;
sub test_warning_path { "/__test_warnings" }
package main;
use Test::More tests => 42;
my $s = My::WebServer::Test->new;
my $url_root = $s->started_ok("start up my web server");
my $mech = WWW::Mechanize->new;
$mech->get("$url_root/some_action");
$mech->get("/__test_warnings");
my @warnings = My::WebServer::Test->decode_warnings($mech->content);
is(@warnings, 0, "some_action gave no warnings");
DESCRIPTION
Warnings are an important part of any application. Your web application should warn the user when something is amiss.
Almost as importantly, we want to be able to test that the web application gracefully copes with bad input, the back button, and all other
aspects of the user experience.
Unfortunately, tests seldom cover what happens when things go poorly. Are you "sure" that your application checks authorization for that
action? Are you "sure" it will tomorrow?
This module lets you retrieve the warnings that your forked server throws. That way you can test that your application continues to throw
warnings when it makes sense. Catching the warnings also keeps your test output tidy. Finally, you'll be able to see when your application
throws new, unexpected warnings.
SETUP
The way this module works is it catches warnings and makes them available on a special URL (which must be defined by you in the
"test_warning_path" method). You can use "WWW::Mechanize" (or whichever HTTP agent you prefer) to download the warnings. The warnings will
be serialized. Use decode_warnings to get the list of warnings seen so far (since last request anyway).
Warnings are encoded using Storable by default, but your subclass may override the "encode_warnings" and "decode_warnings" methods.
TIPS
Setting the "TEST_VERBOSE" environment variable to a true value will cause warnings to be displayed immediately, even if they would be
captured and tested later.
AUTHOR
Shawn M Moore, "<sartak at bestpractical.com>"
BUGS
Please report any bugs or feature requests to "bug-test-http-server-simple-stashwarnings at rt.cpan.org", or through the web interface at
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=test-http-server-simple-stashwarnings>.
COPYRIGHT & LICENSE
Copyright 2008 Best Practical Solutions.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2009-07-07 Test::HTTP::Server::Simple::StashWarnings(3pm)