Skip to content

fail -> panic #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ impl PostgresConnection {
/// let maybe_stmt = conn.prepare("SELECT foo FROM bar WHERE baz = $1");
/// let stmt = match maybe_stmt {
/// Ok(stmt) => stmt,
/// Err(err) => fail!("Error preparing statement: {}", err)
/// Err(err) => panic!("Error preparing statement: {}", err)
/// };
pub fn prepare<'a>(&'a self, query: &str) -> PostgresResult<PostgresStatement<'a>> {
let mut conn = self.conn.borrow_mut();
Expand Down Expand Up @@ -1283,7 +1283,7 @@ impl<'conn> PostgresStatement<'conn> {
/// # let baz = true;
/// let mut rows = match stmt.query(&[&baz]) {
/// Ok(rows) => rows,
/// Err(err) => fail!("Error running query: {}", err)
/// Err(err) => panic!("Error running query: {}", err)
/// };
/// for row in rows {
/// let foo: i32 = row.get("foo");
Expand Down Expand Up @@ -1488,7 +1488,7 @@ impl<'stmt> PostgresRow<'stmt> {
pub fn get<I, T>(&self, idx: I) -> T where I: RowIndex + fmt::Show + Clone, T: FromSql {
match self.get_opt(idx.clone()) {
Ok(ok) => ok,
Err(err) => fail!("error retrieving column {}: {}", idx, err)
Err(err) => panic!("error retrieving column {}: {}", idx, err)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ macro_rules! try_pg_desync(
macro_rules! check_desync(
($e:expr) => ({
if $e.canary() != CANARY {
fail!("PostgresConnection use after free. See mozilla/rust#13246.");
panic!("PostgresConnection use after free. See mozilla/rust#13246.");
}
if $e.is_desynchronized() {
return Err(PgStreamDesynchronized);
Expand Down
2 changes: 1 addition & 1 deletion tests/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use postgres::pool::PostgresConnectionPool;
#[test]
// Make sure we can take both connections at once and can still get one after
fn test_pool() {
let pool = or_fail!(PostgresConnectionPool::new("postgres://postgres@localhost",
let pool = or_panic!(PostgresConnectionPool::new("postgres://postgres@localhost",
NoSsl, 2));

let (s1, r1) = comm::channel();
Expand Down
Loading