 					break
 				}
 				
-				eventHandler.callback(update.id)
+				do {
+					try eventHandler.callback(update.id)
+				} catch let error {
+					fail(error)
+				}
 			}
 		}
 	}

		sqlite3_update_hook(db, onUpdate, unsafeBitCast(self, UnsafeMutablePointer<Void>.self))
	}
	
	public func on<T : Sqlable>(change : Change, to : T.Type, id : Int? = nil, doThis : (id : Int) -> Void) {
		eventHandlers.append((change, to.tableName, id, doThis))
	}
	

	public var didUpdate : ((table : String, id : Int, change : Change) -> Void)?
	public var didFail : (String -> Void)?
	
	var eventHandlers : [(change : Change, tableName : String, id : Int?, callback : Int throws -> Void)] = []
	
	var pendingUpdates : [[(change : Change, tableName : String, id : Int)]] = []
	
