mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Update user-related exceptions to UserSideException
This commit is contained in:
@ -16,7 +16,7 @@ import os
|
||||
import time
|
||||
|
||||
from platformio import __accounts_api__, app
|
||||
from platformio.exception import PlatformioException
|
||||
from platformio.exception import PlatformioException, UserSideException
|
||||
from platformio.http import HTTPClient, HTTPClientError
|
||||
|
||||
|
||||
@ -24,11 +24,11 @@ class AccountError(PlatformioException):
|
||||
MESSAGE = "{0}"
|
||||
|
||||
|
||||
class AccountNotAuthorized(AccountError):
|
||||
class AccountNotAuthorized(AccountError, UserSideException):
|
||||
MESSAGE = "You are not authorized! Please log in to PlatformIO Account."
|
||||
|
||||
|
||||
class AccountAlreadyAuthorized(AccountError):
|
||||
class AccountAlreadyAuthorized(AccountError, UserSideException):
|
||||
MESSAGE = "You are already authorized with {0} account."
|
||||
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
# limitations under the License.
|
||||
|
||||
from platformio import util
|
||||
from platformio.exception import PlatformioException, UserSideException
|
||||
from platformio.exception import UserSideException
|
||||
|
||||
|
||||
class PackageException(PlatformioException):
|
||||
class PackageException(UserSideException):
|
||||
pass
|
||||
|
||||
|
||||
@ -51,14 +51,14 @@ class MissingPackageManifestError(ManifestException):
|
||||
MESSAGE = "Could not find one of '{0}' manifest files in the package"
|
||||
|
||||
|
||||
class UnknownPackageError(UserSideException):
|
||||
class UnknownPackageError(PackageException):
|
||||
MESSAGE = (
|
||||
"Could not find the package with '{0}' requirements for your system '%s'"
|
||||
% util.get_systype()
|
||||
)
|
||||
|
||||
|
||||
class NotGlobalLibDir(UserSideException):
|
||||
class NotGlobalLibDir(PackageException):
|
||||
MESSAGE = (
|
||||
"The `{0}` is not a PlatformIO project.\n\n"
|
||||
"To manage libraries in global storage `{1}`,\n"
|
||||
|
@ -18,7 +18,7 @@ import subprocess
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from platformio import proc
|
||||
from platformio.package.exception import PlatformioException, UserSideException
|
||||
from platformio.exception import UserSideException
|
||||
|
||||
|
||||
class VCSBaseException(UserSideException):
|
||||
@ -70,7 +70,7 @@ class VCSClientBase:
|
||||
self.get_cmd_output(["--version"])
|
||||
else:
|
||||
assert self.run_cmd(["--version"])
|
||||
except (AssertionError, OSError, PlatformioException) as exc:
|
||||
except (AssertionError, OSError) as exc:
|
||||
raise VCSBaseException(
|
||||
"VCS: `%s` client is not installed in your system" % self.command
|
||||
) from exc
|
||||
|
@ -12,10 +12,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from platformio.exception import PlatformioException
|
||||
from platformio.exception import UserSideException
|
||||
|
||||
|
||||
class PlatformException(PlatformioException):
|
||||
class PlatformException(UserSideException):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -180,7 +180,7 @@ def _load_build_metadata(project_dir, env_names, debug=False):
|
||||
):
|
||||
raise result.exception
|
||||
if '"includes":' not in result.output:
|
||||
raise exception.PlatformioException(result.output)
|
||||
raise exception.UserSideException(result.output)
|
||||
return _get_cached_build_metadata(project_dir, env_names)
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@ import hashlib
|
||||
import os
|
||||
import queue
|
||||
import re
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
@ -271,6 +272,7 @@ def log_exception(exc):
|
||||
"name": exc.__class__.__name__,
|
||||
"description": str(exc),
|
||||
"traceback": trace,
|
||||
"cmd_args": sys.argv[1:],
|
||||
"is_fatal": is_fatal,
|
||||
}
|
||||
log_event("exception", params)
|
||||
|
Reference in New Issue
Block a user