Example #1
0
        def eb(fail):
            code = getattr(fail.value, 'code', 'NetStream.Play.Failed')
            description = util.getFailureMessage(fail) or 'Internal Server Error'

            self.sendStatus(status.error(code, description))

            return fail
Example #2
0
        def eb(fail):
            code = getattr(fail.value, 'code', 'NetStream.Play.Failed')
            description = util.getFailureMessage(fail) or 'Internal Server Error'

            self.sendStatus(status.error(code, description))

            return fail
Example #3
0
    def test_status(self):
        """
        Sending a L{status.IStatus} should succeed.
        """
        s = status.error('AnErrorOccurred', 'This is a description', foo='bar')
        self.stream.sendStatus(s)

        msg = self.messages.pop()

        self.assertEqual(self.messages, [])

        self.checkMessage(msg, level='error', code='AnErrorOccurred',
            description='This is a description', extra={'foo': 'bar'})
Example #4
0
    def test_status(self):
        """
        Sending a L{status.IStatus} should succeed.
        """
        s = status.error('AnErrorOccurred', 'This is a description', foo='bar')
        self.stream.sendStatus(s)

        msg = self.messages.pop()

        self.assertEqual(self.messages, [])

        self.checkMessage(msg, level='error', code='AnErrorOccurred',
            description='This is a description', extra={'foo': 'bar'})
Example #5
0
        def send_status(result):
            s = None

            if isinstance(result, failure.Failure):
                code = getattr(result.value, 'code', 'NetConnection.Call.Failed')
                description = util.getFailureMessage(result) or 'Internal Server Error'

                s = status.error(code, description)
            else:
                s = status.status('NetStream.Publish.Start',
                    description='%s is now published.' % (name,),
                    clientid=self.client.id)

            self.sendStatus(s)

            return result
Example #6
0
        def send_status(result):
            s = None

            if isinstance(result, failure.Failure):
                code = getattr(result.value, 'code', 'NetConnection.Call.Failed')
                description = util.getFailureMessage(result) or 'Internal Server Error'

                s = status.error(code, description)
            else:
                s = status.status('NetStream.Publish.Start',
                    description='%s is now published.' % (name,),
                    clientid=self.client.id)

            self.sendStatus(s)

            return result