Open ziaratban opened 4 years ago
generated from https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.yml
examples
use yii\mongodb\ErrorCode; try{ // mongodb commands ... }catch(\Exception $e){ if(ErrorCode::is($e)) echo 'this is a mongodb error.'; } try{ // mongodb commands ... }catch(\Exception $e){ if(ErrorCode::is($e,ErrorCode::WriteConflict)) echo 'this is a mongodb write conflict error.'; }
generated from https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.yml
examples