-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
880 additions
and
564 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import logging | ||
|
||
|
||
class Component: | ||
def __init__(self, *args, **kwargs): | ||
self.logger = logging.getLogger(self.__class__.__name__) | ||
self.logger.info('Init') | ||
|
||
async def run(self, mediator): | ||
self.logger.info('Run') | ||
|
||
async def shutdown(self, mediator): | ||
self.logger.info('Shutdown') |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/tribler-core/tribler_core/modules/discovery/community.py
This file was deleted.
Oops, something went wrong.
Empty file.
22 changes: 22 additions & 0 deletions
22
src/tribler-core/tribler_core/modules/exception_handler/component.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from asyncio import get_event_loop | ||
|
||
from tribler_common.sentry_reporter.sentry_reporter import SentryReporter | ||
|
||
from tribler_core.modules.component import Component | ||
from tribler_core.modules.exception_handler.exception_handler import CoreExceptionHandler | ||
from tribler_core.utilities.unicode import hexlify | ||
|
||
|
||
class ExceptionHandlerComponent(Component): | ||
async def run(self, mediator): | ||
await super().run(mediator) | ||
config = mediator.config | ||
trustchain_keypair = mediator.trustchain_keypair | ||
|
||
exception_handler = CoreExceptionHandler(self.logger, config=config.error_handling) | ||
get_event_loop().set_exception_handler(exception_handler.unhandled_error_observer) | ||
|
||
user_id_str = hexlify(trustchain_keypair.key.pk).encode('utf-8') | ||
SentryReporter.set_user(user_id_str) | ||
|
||
mediator.optional['exception_handler'] = exception_handler |
File renamed without changes.
Oops, something went wrong.