Skip to content

Instantly share code, notes, and snippets.

@notomato
Created August 17, 2012 02:56
Show Gist options
  • Save notomato/3375547 to your computer and use it in GitHub Desktop.
Save notomato/3375547 to your computer and use it in GitHub Desktop.
Error handling example
<?php
$method = array(Connections::get('default'), 'read');
ErrorHandler::apply($method, array(), function($error, $params) {
$queryParams = json_encode($params['query']);
$msg = "Query error: {$error['message']}";
Logger::warning("{$msg}, data: {$queryParams}");
return new DocumentSet();
});
// Source: http://www.slideshare.net/nateabele/the-state-of-lithium
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment