Code Monkey home page Code Monkey logo

error-tracker's Issues

Error: ModuleNotFoundError: No module named 'flask

Hi, I tried to use this with Django and in the moment in put 'error_tracker.DjangoErrorTracker' in settings.py I have the error below.

File ".../lib/python3.7/site-packages/error_tracker/__init__.py", line 14, in <module>
    from error_tracker.flask import *
File ".../lib/python3.7/site-packages/error_tracker/flask/__init__.py", line 10, in <module>
    from .flask_error import AppErrorTracker
File ".../lib/python3.7/site-packages/error_tracker/flask/flask_error.py", line 15, in <module>
    from flask import _request_ctx_stack as stack
ModuleNotFoundError: No module named 'flask'

Thank you.

Reduce dependencies?

Currently, this package depends on Flask, Django and Django-rest-framework, but is that really needed? Typically, when this library is used with django and/or django-rest-framework or Flask, then the application will already depend on those packages and error-tracker could just import them.

Typically an application will not use both Flask and Django at the same time, so this installs a bunch of packages that are never used.

Maybe the dependencies can be made optional using setup.py's "extra" feature, or just removed altogether (with the responsibility for installing these moved to the application). The latter might need some changes in the code (haven't checked) to ensure things are only imported when actually needed and/or to have a graceful fallback if imports are not available.

UserWarning: APP_ERROR_DB_MODEL is not set using default model

/error_tracker/django/init.py:28: UserWarning: APP_ERROR_DB_MODEL is not set using default model
warnings.warn("APP_ERROR_DB_MODEL is not set using default model")
/error_tracker/libs/utils.py:121: UserWarning: Default Masking module will be used
warnings.warn(message)
/error_tracker/libs/utils.py:121: UserWarning: Default Notification module will be used
warnings.warn(message)
/error_tracker/libs/utils.py:121: UserWarning: Default ContextBuilder module will be used
warnings.warn(message)

Change break migrations

Hello,

the change

dependencies = [
        ('django', '0001_initial'),
    ]
to
 dependencies = [
        ('error_tracker', '0001_initial'),
    ]

made migrations broken.

The error message

django.db.migrations.exceptions.NodeNotFoundError: Migration django.0002_auto_20201018_1311 dependencies reference nonexistent parent node ('error_tracker', '0001_initial')

Regards

Simplify error reporting

Take Sentry SDK as a good example of such.

Capture errors

https://docs.sentry.io/platforms/python/#capturing-errors

from sentry_sdk import capture_exception

try:
    a_potentially_failing_function()
except Exception as e:
    # Alternatively the argument can be omitted
    capture_exception(e)

Capture messages

https://docs.sentry.io/error-reporting/capturing/?platform=python#capturing-messages

from sentry_sdk import capture_message

capture_message('Something went wrong')

Extra context

https://docs.sentry.io/platforms/python/#extra-context

from sentry_sdk import configure_scope

with configure_scope() as scope:
    scope.set_extra("character_name", "Mighty Fighter")

All variables in traceback are `None`

I used the 3.0.0 version of error -tracker for Django 4.2.1 for some time. In my admin in all traceback, I see None instead of the actual value of variables.

I searched in the documentation but don't see anything about It. I don't have any masking variables set.

Zrzut ekranu 2023-07-16 o 12 50 48

Add support for Django REST Framework

The class DefaultDjangoContextBuilder of the error_tracker.django.utils needs some extensions. In particular, in case of Django REST Framework (DRF), the request instance has no POST (request.POST is empty dict). Instead data is stored in request.data. You could simply check, if it's instance of rest_framework.request.Request, then handle as DRF request, otherwise standard Django.

NotificationMixin not working Without set APP_ERROR_RECIPIENT_EMAIL and APP_ERROR_EMAIL_SENDER

I create the class on django

class Notifier(NotificationMixin):
    def notify(self, request, exception,
               email_subject=None,
               email_body=None,
               from_email=None,
               recipient_list=None):
            BaseSlackNotification.send_notification(f"{exception}\n {request}",
                                                settings.SLACK_NEW_ERR0R)

I put on settings
APP_ERROR_NOTIFICATION_MODULE = "apps.commons.slack_notifications.Notifier"
and not works, in debugger never stop on method on exception, but the except show's on error page

Error on warnings library

To be raised an exception must derive from BaseException

File "/.../lib/python3.8/site-packages/error_tracker/django/__init__.py", line 43, in get_exception_model
    raise warnings.warn(
TypeError: exceptions must derive from BaseException

Extend Django ErrorModel

Hi, I saw on the docs that I can set a model to replace the default ErrorModel but I need to implement all abstract methods. And if I want to extend the ErrorModel, this would be possible?

Record all errors (do not overwrite)

At the moment, errors are overwritten. A better approach would be to simply group similar errors together (Sentry way) and allow to navigate from one to another.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.