• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / zope.app.error / 10236023860

03 Feb 2023 07:02AM CUT coverage: 100.0%. Remained the same
10236023860

push

github

web-flow
Config with pure python template (#5)

* Drop support for Python 2.7, 3.5, 3.6.
* Add support for Python 3.11.

4 of 4 branches covered (100.0%)

Branch coverage included in aggregate %.

16 of 16 new or added lines in 5 files covered. (100.0%)

99 of 99 relevant lines covered (100.0%)

1.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/zope/app/error/browser/__init__.py
1
##############################################################################
2
#
3
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
12
#
13
##############################################################################
14
"""Define view component for event utility control.
15
"""
16
from zope.component import getUtility
1✔
17
from zope.error.interfaces import IErrorReportingUtility
1✔
18
from zope.error.interfaces import ILocalErrorReportingUtility
1✔
19
from zope.publisher.browser import BrowserView
1✔
20
from zope.traversing.browser.absoluteurl import absoluteURL
1✔
21

22

23
class EditErrorLog:
1✔
24
    __used_for__ = ILocalErrorReportingUtility
1✔
25

26
    def updateProperties(self, keep_entries, copy_to_zlog=None,
1✔
27
                         ignored_exceptions=None):
28
        errorLog = self.context
1✔
29
        copy_to_zlog = 0 if copy_to_zlog is None else copy_to_zlog
1✔
30
        errorLog.setProperties(keep_entries, copy_to_zlog, ignored_exceptions)
1✔
31
        return self.request.response.redirect('@@configure.html')
1✔
32

33

34
class ErrorRedirect(BrowserView):
1✔
35

36
    def action(self):
1✔
37
        # Some locations (eg ++etc++process) throw a TypeError exception when
38
        # finding their absoluteurl, if this happens catch the error and
39
        # redirect the browser to the site root "/@@errorRedirect.html"
40
        # to handle redirection to the site error logger instead
41
        try:
1✔
42
            err = getUtility(IErrorReportingUtility)
1✔
43
            url = absoluteURL(err, self.request)
1✔
44
        except TypeError:
1✔
45
            url = self.request.getApplicationURL() + "/@@errorRedirect.html"
1✔
46
        else:
47
            url = url + "/@@SelectedManagementView.html"
1✔
48

49
        self.request.response.redirect(url)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc