Skip to content
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

All error codes in mongodb #306

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ziaratban
Copy link
Contributor

@ziaratban ziaratban commented Apr 9, 2020

generated from https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.yml

Q A
Is bugfix? no
New feature? yes
Breaks BC? no
Tests pass? no

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.';
}

@samdark samdark added the type:enhancement Enhancement label Apr 9, 2020
src/ErrorCodes.php Outdated Show resolved Hide resolved
src/ErrorCodes.php Outdated Show resolved Hide resolved
src/ErrorCodes.php Outdated Show resolved Hide resolved
src/ErrorCodes.php Outdated Show resolved Hide resolved
src/ErrorCodes.php Outdated Show resolved Hide resolved
src/ErrorCodes.php Outdated Show resolved Hide resolved
src/ErrorCodes.php Outdated Show resolved Hide resolved
src/ErrorCodes.php Outdated Show resolved Hide resolved
@samdark samdark added the status:under development Someone is working on a pull request. label Apr 9, 2020
ziaratban and others added 9 commits April 9, 2020 22:24
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
@ziaratban ziaratban changed the title All errors code in mongodb All error codes in mongodb Apr 9, 2020
@samdark samdark added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels Apr 12, 2020
@samdark samdark added this to the 2.1.10 milestone Apr 14, 2020
@samdark samdark modified the milestones: 2.1.10, 2.1.11 Nov 10, 2020
@samdark samdark modified the milestones: 2.1.11, 2.1.12 Dec 23, 2020
@samdark samdark removed this from the 2.1.12 milestone Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review. type:enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants