How to use the iotedgedev.decorators.suppress_all_exceptions function in iotedgedev

To help you get started, we’ve selected a few iotedgedev examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / iotedgedev / tests / test_decorators.py View on Github external
    @suppress_all_exceptions('fallback')
    def test_exception_fallback():
        raise Exception
    assert test_exception_fallback() == 'fallback'
github Azure / iotedgedev / tests / test_decorators.py View on Github external
    @suppress_all_exceptions()
    def test_valid():
        return 'Everything is OK'
    assert test_valid() == 'Everything is OK'
github Azure / iotedgedev / tests / test_decorators.py View on Github external
    @suppress_all_exceptions()
    def test_exception_nofallback():
        raise Exception
    assert not test_exception_nofallback()
github Azure / iotedgedev / iotedgedev / telemetry.py View on Github external
@suppress_all_exceptions()
def success():
    _session.result = 'Success'
github Azure / iotedgedev / iotedgedev / telemetry.py View on Github external
@suppress_all_exceptions()
def _get_AI_key():
    from iotedgedev import __AIkey__ as key
    return key
github Azure / iotedgedev / iotedgedev / telemetry.py View on Github external
@suppress_all_exceptions()
def fail(exception, summary):
    _session.exception = exception
    _session.result = 'Fail'
    _session.result_summary = summary
github Azure / iotedgedev / iotedgedev / telemetry.py View on Github external
    @suppress_all_exceptions()
    @hash256_result
    def _get_hash_mac_address(self):
        s = ''
        for index, c in enumerate(hex(uuid.getnode())[2:].upper()):
            s += c
            if index % 2:
                s += '-'

        s = s.strip('-')
        return s
github Azure / iotedgedev / iotedgedev / telemetry.py View on Github external
@suppress_all_exceptions()
def add_extra_props(props):
    if props is not None:
        _session.extra_props.update(props)
github Azure / iotedgedev / iotedgedev / telemetry.py View on Github external
@suppress_all_exceptions(fallback_return=None)
def _get_core_version():
    from iotedgedev import __version__ as core_version
    return core_version
github Azure / iotedgedev / iotedgedev / telemetry.py View on Github external
@suppress_all_exceptions()
def _upload_telemetry_with_user_agreement(payload, **kwargs):
    # Call telemetry uploader as a subprocess to prevent blocking iotedgedev process
    subprocess.Popen([sys.executable, os.path.realpath(telemetryuploader.__file__), payload], **kwargs)