- Timestamp:
- 04/10/12 11:39:50 (12 years ago)
- Location:
- trunk/prototype
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/Sync.php
r5715 r5905 106 106 $args = array( $args ); 107 107 108 Controller::addFallbackHandler( 0, function($e){ throw $e; } ); 109 108 110 foreach( $args as $i => $data ) 109 111 { … … 122 124 $dt = prepare( $concept, $id, $dt, $data, $oldIds, $mounted, $synced ); 123 125 124 $result = Controller::put( array( 'concept' => $concept, 'id' => $id ), $dt ); 126 try{ 127 $result = Controller::put( array( 'concept' => $concept, 'id' => $id ), $dt ); 128 } 129 catch( Exception $e ){ 130 $return[ $uri ] = $e->getMessage(); 131 unset( $data[$uri] ); 132 continue; 133 } 125 134 126 135 if( !$result ) -
trunk/prototype/api/controller.php
r5811 r5905 28 28 static $isConcept = array(); 29 29 static $hasOne = array(); 30 static $fallbackHandlers = array(); 30 31 static $txID = 0; 31 32 static $wallet; … … 598 599 public static function fallback( $exception ) 599 600 { 601 $code = $exception->getCode(); 602 603 if( isset( self::$fallbackHandlers[ $code ] ) ) 604 return self::$fallbackHandlers[ $code ]( $exception ); 605 600 606 error_log( $exception->getMessage() ); 601 607 return( true ); 608 } 609 610 public static function addFallbackHandler( $code, $function ) 611 { 612 self::$fallbackHandlers[ $code ] = $function; 602 613 } 603 614 /*
Note: See TracChangeset
for help on using the changeset viewer.