custom-error


Namecustom-error JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/Anthonyzok521/pypi-custom-error
SummaryCreate your custom errors and I have control of them with Custom Error
upload_time2024-07-14 16:49:59
maintainerNone
docs_urlNone
authorAnthony Carrillo
requires_pythonNone
licenseMIT License Copyright (c) 2024 Anthony Carrillo AC GAMES Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords custom error custom_error python error error custom exception custom python exception exception custom_exception
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Custom Error

Script to throw custom errors in Python

> Create your custom errors and I have control of them with Custom Error

## Use

```python
'''
Test of the module Custome Error
'''
from custom_error import Error

if __name__ == '__main__':
    try:
        number:float = -0.2

        if number < 0.0 or number > 1.0:
            raise Error("Only ranges between 0.0 and 1.0 are allowed", "Invalid Range")
    except Error as e:
        print(e.info())

```

## Sintax

```python
Error(message:str, type_error:str = '')
```

**type_error** (str): Type of the error (optional).<br>
**message** (str): Error message (defaults to an empty string).

```python
Error('My message of error', 'Type of error (optional)')
```

## Show info of error
```python
err = Error('Erro1') #With instance
print(err.info())   #Using method info() -> str

print(Error("Error 2", "Test").info())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Anthonyzok521/pypi-custom-error",
    "name": "custom-error",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "custom error, custom_error, python error, error, custom exception, custom, python exception, exception, custom_exception",
    "author": "Anthony Carrillo",
    "author_email": "anthonyzok521@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/18/d8/d4089ad06860811cb26f54539d83772d15290b6bc4dbcf11e8f560f757ee/custom_error-1.0.0.tar.gz",
    "platform": null,
    "description": "# Custom Error\r\n\r\nScript to throw custom errors in Python\r\n\r\n> Create your custom errors and I have control of them with Custom Error\r\n\r\n## Use\r\n\r\n```python\r\n'''\r\nTest of the module Custome Error\r\n'''\r\nfrom custom_error import Error\r\n\r\nif __name__ == '__main__':\r\n    try:\r\n        number:float = -0.2\r\n\r\n        if number < 0.0 or number > 1.0:\r\n            raise Error(\"Only ranges between 0.0 and 1.0 are allowed\", \"Invalid Range\")\r\n    except Error as e:\r\n        print(e.info())\r\n\r\n```\r\n\r\n## Sintax\r\n\r\n```python\r\nError(message:str, type_error:str = '')\r\n```\r\n\r\n**type_error** (str): Type of the error (optional).<br>\r\n**message** (str): Error message (defaults to an empty string).\r\n\r\n```python\r\nError('My message of error', 'Type of error (optional)')\r\n```\r\n\r\n## Show info of error\r\n```python\r\nerr = Error('Erro1') #With instance\r\nprint(err.info())   #Using method info() -> str\r\n\r\nprint(Error(\"Error 2\", \"Test\").info())\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Anthony Carrillo AC GAMES  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Create your custom errors and I have control of them with Custom Error",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Anthonyzok521/pypi-custom-error"
    },
    "split_keywords": [
        "custom error",
        " custom_error",
        " python error",
        " error",
        " custom exception",
        " custom",
        " python exception",
        " exception",
        " custom_exception"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a0034fe567c849d99c1be78ac390157aea012f83fb2baf499e0e3e60b23a1b37",
                "md5": "1f9422099f8d33fb527affedc88315ef",
                "sha256": "2539af765a9720183ddc4d4da4ab5561a40844c7c6900ce1ab4d481b272f81c1"
            },
            "downloads": -1,
            "filename": "custom_error-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f9422099f8d33fb527affedc88315ef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4041,
            "upload_time": "2024-07-14T16:49:58",
            "upload_time_iso_8601": "2024-07-14T16:49:58.025685Z",
            "url": "https://files.pythonhosted.org/packages/a0/03/4fe567c849d99c1be78ac390157aea012f83fb2baf499e0e3e60b23a1b37/custom_error-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18d8d4089ad06860811cb26f54539d83772d15290b6bc4dbcf11e8f560f757ee",
                "md5": "1aed92242172f9dfc02a96c9b79545d5",
                "sha256": "6d52299647ba68c3e8baa484adb16c71533e38bef7f37d8d6387548a941f8a41"
            },
            "downloads": -1,
            "filename": "custom_error-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1aed92242172f9dfc02a96c9b79545d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3185,
            "upload_time": "2024-07-14T16:49:59",
            "upload_time_iso_8601": "2024-07-14T16:49:59.554109Z",
            "url": "https://files.pythonhosted.org/packages/18/d8/d4089ad06860811cb26f54539d83772d15290b6bc4dbcf11e8f560f757ee/custom_error-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-14 16:49:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Anthonyzok521",
    "github_project": "pypi-custom-error",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "custom-error"
}
        
Elapsed time: 4.52825s