Changed error codes again.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2019-08-09 13:01:54 +02:00
parent 450873ed22
commit 3b29caaa54
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
3 changed files with 13 additions and 14 deletions

View File

@ -7,7 +7,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12)
endif()
project(remwharead
VERSION 0.7.1
VERSION 0.7.2
LANGUAGES CXX)
# DESCRIPTION was introduced in version 3.9.
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.9))

View File

@ -2,7 +2,7 @@
:doctype: manpage
:Author: tastytea
:Email: tastytea@tastytea.de
:Date: 2019-08-08
:Date: 2019-08-09
:Revision: 0.0.0
:man source: remwharead
:man manual: General Commands Manual
@ -160,12 +160,12 @@ proxy support yet, sorry.
== ERROR CODES
[options="header",cols=">,<,<"]
|===================================================================
| Code | Error name | Explanation
| 5 | EIO | File / database could not be opened.
| 22 | EINVAL | Missing options / Argument not understood.
| 113 | EHOSTUNREACH | Could not fetch URI.
|===================================================================
|====================================================
| Code | Explanation
| 1 | Missing options / Argument not understood.
| 2 | File / database could not be opened.
| 3 | Could not fetch URI.
|====================================================
== SEE ALSO

View File

@ -20,7 +20,6 @@
#include <fstream>
#include <locale>
#include <list>
#include <cerrno>
#include "sqlite.hpp"
#include "remwharead_cli.hpp"
#include "uri.hpp"
@ -55,7 +54,7 @@ int App::main(const std::vector<std::string> &args)
{
if (_argument_error)
{
return EINVAL;
return 1;
}
if (args.size() > 0)
{
@ -64,7 +63,7 @@ int App::main(const std::vector<std::string> &args)
if (_uri.empty() && _format == export_format::undefined)
{
cerr << "Error: You have to specify either an URI or --export.\n";
return EINVAL;
return 1;
}
}
@ -72,7 +71,7 @@ int App::main(const std::vector<std::string> &args)
if (!db)
{
cerr << "Error: Database could not be opened.\n";
return EIO;
return 2;
}
if (!_uri.empty())
@ -83,7 +82,7 @@ int App::main(const std::vector<std::string> &args)
{
cerr << "Error: Could not fetch page.\n";
cerr << page.error << endl;
return EHOSTUNREACH;
return 3;
}
archive_answer archive;
if (_archive)
@ -105,7 +104,7 @@ int App::main(const std::vector<std::string> &args)
if (!file.good())
{
cerr << "Error: Could not open file: " << _file << endl;
return EIO;
return 2;
}
}