From ea45cef780f2dee229517b00e9e4df2a03e0379c Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 15 Feb 2014 18:28:10 -0800 Subject: [PATCH] Update error checking example --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c97dd46b..1ad35e5b 100644 --- a/README.md +++ b/README.md @@ -160,9 +160,10 @@ methods, there is a second variant prefixed with `try_` which returns a match conn.try_execute(query, params) { Ok(updates) => println!("{} rows were updated", updates), Err(err) => match err.code { - NotNullViolation => println!("Something was NULL that shouldn't be"), - SyntaxError => println!("Invalid query syntax"), - _ => println!("A bad thing happened: {}", err.message), + PgDbError(NotNullViolation) => + println!("Something was NULL that shouldn't be"), + PgDbError(SyntaxError) => println!("Invalid query syntax"), + _ => println!("A bad thing happened: {}", err), } } ```