SmileError


NameSmileError JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/sitthykun/smileerror
Summarypython error class is, to make it simple structure
upload_time2024-01-17 03:32:08
maintainer
docs_urlNone
authorSitthykun LY
requires_python>=3.8
licenseMIT License
keywords python error base class errorbase error
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # smileerror
## version 1.0.1
To make it a standard structure

```
# external library
from smileerror.ErrorBase import ErrorBase
# or pypi
#from ErrorBase import ErrorBase


class TestClass:
	"""
 	"""
	def __init__(self):
 		"""
   		"""
	 	# private
	 	self.error	= ErrorBase()

   	def divideByZero(self, inputData: int) -> float:
   		"""
	 	"""
   		self.error.setFalse()

   		try:
	 		return inputData / 0
	
		except ZeroDivisionError as e:
			self.error.setTrue(code= 2, message= str(e))
			return -1
		
		except Exception as e:
  			self.error.setTrue(code= 1, message= str(e))
  			return -1


# render code
test	= TestClass()
result	= test.divideByZero(22)

if test.error.isTrue():
	print(f'Show the error message error: {test.error.getMessage()}')

# if there is a complex structure, let try by this way
if test.findCode(2):
	print(f'Show the error message error: {test.error.getMessage()}')
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sitthykun/smileerror",
    "name": "SmileError",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "python error base class,errorbase,error",
    "author": "Sitthykun LY",
    "author_email": "ly.sitthykun@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bb/17/e48ca19c2b3118cb29a4103c118123d9ce9dcbd2c44b7b2eedb1e911ecef/SmileError-1.0.1.tar.gz",
    "platform": "All",
    "description": "# smileerror\n## version 1.0.1\nTo make it a standard structure\n\n```\n# external library\nfrom smileerror.ErrorBase import ErrorBase\n# or pypi\n#from ErrorBase import ErrorBase\n\n\nclass TestClass:\n\t\"\"\"\n \t\"\"\"\n\tdef __init__(self):\n \t\t\"\"\"\n   \t\t\"\"\"\n\t \t# private\n\t \tself.error\t= ErrorBase()\n\n   \tdef divideByZero(self, inputData: int) -> float:\n   \t\t\"\"\"\n\t \t\"\"\"\n   \t\tself.error.setFalse()\n\n   \t\ttry:\n\t \t\treturn inputData / 0\n\t\n\t\texcept ZeroDivisionError as e:\n\t\t\tself.error.setTrue(code= 2, message= str(e))\n\t\t\treturn -1\n\t\t\n\t\texcept Exception as e:\n  \t\t\tself.error.setTrue(code= 1, message= str(e))\n  \t\t\treturn -1\n\n\n# render code\ntest\t= TestClass()\nresult\t= test.divideByZero(22)\n\nif test.error.isTrue():\n\tprint(f'Show the error message error: {test.error.getMessage()}')\n\n# if there is a complex structure, let try by this way\nif test.findCode(2):\n\tprint(f'Show the error message error: {test.error.getMessage()}')\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "python error class is, to make it simple structure",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/sitthykun/smileerror"
    },
    "split_keywords": [
        "python error base class",
        "errorbase",
        "error"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e2529351f766412d7a91de534358aaee178cefff2fcf17878ffff6cf2782965",
                "md5": "6194f552050ee2dbb827059cfacd6fca",
                "sha256": "a80317b380f760fecb4658eb9106d767fce93fd2da6909e04330f6b65d14f69f"
            },
            "downloads": -1,
            "filename": "SmileError-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6194f552050ee2dbb827059cfacd6fca",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 2995,
            "upload_time": "2024-01-17T03:32:06",
            "upload_time_iso_8601": "2024-01-17T03:32:06.647861Z",
            "url": "https://files.pythonhosted.org/packages/6e/25/29351f766412d7a91de534358aaee178cefff2fcf17878ffff6cf2782965/SmileError-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb17e48ca19c2b3118cb29a4103c118123d9ce9dcbd2c44b7b2eedb1e911ecef",
                "md5": "81fd32bd6242a55dc5616fcd31307318",
                "sha256": "24cbd3659706d584021ba62d7f62ea47e81acd27bf654942324207ecde8c6ffa"
            },
            "downloads": -1,
            "filename": "SmileError-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "81fd32bd6242a55dc5616fcd31307318",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 2903,
            "upload_time": "2024-01-17T03:32:08",
            "upload_time_iso_8601": "2024-01-17T03:32:08.176941Z",
            "url": "https://files.pythonhosted.org/packages/bb/17/e48ca19c2b3118cb29a4103c118123d9ce9dcbd2c44b7b2eedb1e911ecef/SmileError-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 03:32:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sitthykun",
    "github_project": "smileerror",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "smileerror"
}
        
Elapsed time: 0.18250s