This file is indexed.

/usr/lib/python3/dist-packages/channels/exceptions.py is in python3-django-channels 1.1.8.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from __future__ import unicode_literals

import six


class ConsumeLater(Exception):
    """
    Exception that says that the current message should be re-queued back
    onto its channel as it's not ready to be consumed yet (e.g. global order
    is being enforced)
    """
    pass


class ResponseLater(Exception):
    """
    Exception raised inside a Django view when the view has passed
    responsibility for the response to another consumer, and so is not
    returning a response.
    """
    pass


class RequestTimeout(Exception):
    """
    Raised when it takes too long to read a request body.
    """
    pass


class RequestAborted(Exception):
    """
    Raised when the incoming request tells us it's aborted partway through
    reading the body.
    """
    pass


class DenyConnection(Exception):
    """
    Raised during a websocket.connect (or other supported connection) handler
    to deny the connection.
    """
    pass


class ChannelSocketException(Exception):
    """
    Base Exception is intended to run some action ('run' method)
    when it is raised at a consumer body
    """

    def run(self, message):
        raise NotImplementedError


class WebsocketCloseException(ChannelSocketException):
    """
    ChannelSocketException based exceptions for close websocket connection with code
    """

    def __init__(self, code=None):
        if code is not None and not isinstance(code, six.integer_types) \
                and code != 1000 and not (3000 <= code <= 4999):
            raise ValueError("invalid close code {} (must be 1000 or from [3000, 4999])".format(code))
        self._code = code

    def run(self, message):
        if message.reply_channel.name.split('.')[0] != "websocket":
            raise ValueError("You cannot raise CloseWebsocketError from a non-websocket handler.")
        message.reply_channel.send({"close": self._code or True})


class SendNotAvailableOnDemultiplexer(Exception):
    """
    Raised when trying to send with a WebsocketDemultiplexer. Use the multiplexer instead.
    """
    pass