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() endif()
project(remwharead project(remwharead
VERSION 0.7.1 VERSION 0.7.2
LANGUAGES CXX) LANGUAGES CXX)
# DESCRIPTION was introduced in version 3.9. # DESCRIPTION was introduced in version 3.9.
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.9)) if(NOT (${CMAKE_VERSION} VERSION_LESS 3.9))

View File

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

View File

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