Commit Graph

48 Commits

Author SHA1 Message Date
Matthias Beyer dc162cb167 Fix: Off by one error
When printing the error chain, we print the error and then iterate over
the causes. Hence, we have to increase the printed number by one here,
because 0 (zero) is already printed.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 19:56:13 +01:00
Matthias Beyer 90eaeb642a Remove magic constants in trace_unwrap_exit/map_err_trace_exit_unwrap calls
This patch removes the magic constant we used when calling
`trace_unwrap_exit()` or `map_err_trace_exit_unwrap()`.
We used to call it with `1` as parameter, where the number was the exit
code to use. Now the implementation of the function does it
automatically (using 1 (one) as exit code).

All calls of these functions were fixed. Thanks to vim this was easy.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:52:04 +01:00
Matthias Beyer 9185abcfa5 Update copyright years
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03 18:41:36 +01:00
Matthias Beyer 9fca66aa89 Forbid unsafe code in all crates 2018-11-11 13:05:55 +01:00
Matthias Beyer 4e516ee19d Update version strings
...for the next release, which will be imag 0.10.0!

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-10 11:56:37 +01:00
Matthias Beyer c2f674cc29 libimagerror: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer c160a967ec Add error kinds 2018-10-30 18:46:28 +01:00
Matthias Beyer 1c3bc5951f Update dependency: ansi_term: 0.10 -> 0.11 2018-09-30 15:04:51 +02:00
Matthias Beyer 0a7afee454 Update dependency: error-chain: 0.11 -> 0.12 2018-09-27 15:05:25 +02:00
Matthias Beyer 664edc7943 Update version string: 0.8.0 -> 0.9.0 2018-05-09 11:39:33 +02:00
Matthias Beyer a25f650ca0 Be more ergonomic here 2018-04-25 19:13:51 +02:00
Matthias Beyer 84249e3fb5 Be less verbose when constructing an object
The rust compiler does some fancy things for us: It automatically finds
the right fields if the name of the variable and the file is the same.

Lets use that to reduce boilerplate with this patch.
2018-04-25 19:13:50 +02:00
Matthias Beyer d2dceb6640 Update version numbers: 0.7.0 -> 0.8.0 2018-04-19 10:05:53 +02:00
Matthias Beyer 98f8366e4c Fix documentation in crate metadata 2018-04-17 15:55:08 +02:00
Matthias Beyer 732fc32b75 Fix trace count space width
Was five here, but should be four.
2018-02-20 20:24:27 +01:00
Matthias Beyer 00b86709b6 Use writeln!() instead of write!() 2018-02-20 19:24:34 +01:00
Matthias Beyer c2dfb2ef52 Refactor timetrack subcommands output for broken pipe errors 2018-02-19 11:14:18 +01:00
Matthias Beyer 6a341d3723 Abstract exit code as a type 2018-02-19 11:14:18 +01:00
Matthias Beyer 256bc47222 Refactor into two independent extensions 2018-02-19 10:40:26 +01:00
Matthias Beyer 39107c5296 Add result extension for translating io errors to exit codes 2018-02-19 10:40:26 +01:00
Matthias Beyer 841d3ffb60 Remove OnErr extension which is not used 2018-02-18 20:04:22 +01:00
Matthias Beyer 5b07baddf8 Add error convenience extension 2018-02-12 21:22:39 +01:00
Matthias Beyer 074f9826fd Implement own displaying implementation for the chain 2018-02-12 21:19:48 +01:00
Matthias Beyer 6dd24f3da3 Keep trace_error{,_dbg} for backwards compatibility 2018-02-12 21:19:47 +01:00
Matthias Beyer e481dbfd12 Rewrite libimagerror to be thin layer over error-chain 2018-02-12 21:19:47 +01:00
Matthias Beyer 30d2c28a22 Update version string: 0.6.0 -> 0.7.0 2018-02-11 14:22:24 +01:00
Matthias Beyer 863b52c2f0 Add TraceIterator::trace_unwrap_exit()
* Exits on the first Err(_)
* Introduces new Iterator type for iterating with unwrap and exit on
  error
2018-02-10 16:41:06 +01:00
Matthias Beyer d5a9e4930d Update dates in license header
And add missing header in one file
2018-02-07 02:48:53 +01:00
Matthias Beyer 7731b88c97 Remove map_err_trace_exit() calls in favour of map_err_trace_exit_unwrap() 2018-01-29 09:38:32 +01:00
Matthias Beyer 635d000344 log: 0.4.0-rc.1 -> 0.4.0 2018-01-15 11:21:52 +01:00
Matthias Beyer f209e12410 Update dependency: log: 0.3.* -> 0.4.0-rc.1 2018-01-15 11:20:07 +01:00
Matthias Beyer 529f3f83da
Merge pull request #1187 from matthiasbeyer/libimagerror/display-fix
Improve error output
2018-01-01 20:47:24 +01:00
Matthias Beyer 0ae7b6b387 Do not call description() when displaying the error 2017-12-25 19:44:29 +01:00
Matthias Beyer 3c8dd19d11 Update version strings: 0.5.0 -> 0.6.0 2017-12-25 19:17:07 +01:00
Matthias Beyer a20871eb5e Add badges in Cargo.toml of all crates 2017-10-31 15:03:30 +01:00
Matthias Beyer 3ed9c1fcc8 Merge pull request #1131 from matthiasbeyer/libimagerror/trace-and-unwrap-helper
Add helper for tracing error and exit or unwrap the value
2017-10-12 22:08:48 +02:00
Matthias Beyer bb26d1c895 Update dependency: ansi_term: 0.9 -> 0.10 2017-10-12 19:44:33 +02:00
Matthias Beyer eb4681bf65 Add helper for tracing error and exit or unwrap the value 2017-10-12 19:02:37 +02:00
Matthias Beyer 73f6016221 Update version strings: 0.4.0 -> 0.5.0 2017-09-24 13:05:01 +02:00
Matthias Beyer 7ce44e8090 Remove "IntoError" trait, use error_chain functionality 2017-09-03 21:34:07 +02:00
Matthias Beyer 28d7085b2d Remove error_chain dependency, not needed 2017-09-03 21:33:55 +02:00
Matthias Beyer 9713a4632c Remove error_gen module entirely 2017-09-03 15:42:06 +02:00
Matthias Beyer e77d353c52 Rewrite macros to do error-chain behind the scenes 2017-09-03 15:42:03 +02:00
Matthias Beyer 048517a3c2 Fix readme links in cargo metadata 2017-09-01 18:48:02 +02:00
Matthias Beyer a710a5b72b Remove unused variable 2017-08-31 10:57:19 +02:00
Matthias Beyer d0f8002682 Ensure deny() for warnings is in all crates 2017-08-27 20:08:03 +02:00
Matthias Beyer 2fcead5f53 Fix broken README symlinks
Along: Add files in documentation for modules that not yet had one.
2017-08-27 15:13:25 +02:00
Matthias Beyer 59a3662ac4 Reorganize code in subdirs 2017-08-27 15:12:09 +02:00