Skip to content

Commit

Permalink
v0.1.4: Print more detailed errors from falconeri-worker
Browse files Browse the repository at this point in the history
Include the entire error chain, plus the backtrace (for now). This will
make it easier to debug problems calling `gsutil`.
  • Loading branch information
emk committed Aug 27, 2018
1 parent a6111c3 commit e43a3e1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
20 changes: 15 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion falconeri-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "falconeri-worker"
version = "0.1.2"
version = "0.1.4"
authors = ["Eric Kidd <[email protected]>"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion falconeri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Eric Kidd <[email protected]>"]
name = "falconeri"
version = "0.1.2"
version = "0.1.4"

[dependencies]
base64 = "0.9.2"
Expand Down
3 changes: 2 additions & 1 deletion falconeri_common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[package]
name = "falconeri_common"
version = "0.1.0"
version = "0.1.4"
authors = ["Eric Kidd <[email protected]>"]

[dependencies]
base64 = "0.9.2"
bson = "0.13.0"
cast = "0.2.2"
chrono = { version = "0.4.4", features = ["serde"] }
common_failures = "0.1.1"
diesel = { version = "1.3.0", features = ["chrono", "postgres", "serde_json", "uuid"] }
diesel_migrations = "1.3.0"
failure = "0.1.1"
Expand Down
1 change: 1 addition & 0 deletions falconeri_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern crate base64;
extern crate bson;
pub extern crate cast;
pub extern crate chrono;
extern crate common_failures;
#[macro_use]
pub extern crate diesel;
#[macro_use]
Expand Down
8 changes: 6 additions & 2 deletions falconeri_common/src/models/datum.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use common_failures::display::DisplayCausesAndBacktraceExt;
use prefix::*;
use schema::*;

Expand Down Expand Up @@ -52,13 +53,16 @@ impl Datum {
/// Mark this datum as having been unsuccessfully processed.
pub fn mark_as_error(
&mut self,
error_message: &dyn fmt::Display,
error_message: &dyn DisplayCausesAndBacktraceExt,
conn: &PgConnection,
) -> Result<()> {
*self = diesel::update(datums::table.filter(datums::id.eq(&self.id)))
.set((
datums::status.eq(&Status::Error),
datums::error_message.eq(&format!("{}", error_message)),
datums::error_message.eq(&format!(
"{}",
error_message.display_causes_and_backtrace(),
)),
))
.get_result(conn)
.context("can't mark datum as having failed")?;
Expand Down

0 comments on commit e43a3e1

Please sign in to comment.