async def respond(self, response: Response) -> None: export = self.__export fmt = self.__format response.setContentType(fmt.mediaType) if export: response.setFileName(f'{self.__fileName}.{fmt.ext}') else: response.allowEmbedding() data = self.__builder.build(export).data response.setETag(createETag(data) + b'-dot') try: rendered = await _renderGraph(data, fmt) except Exception as ex: response.setStatus(500, 'Graph rendering failed') response.setContentType('text/plain') response.write(f'Graph rendering failed: {ex}\n') else: response.write(rendered)
async def respond(self, response: Response) -> None: response.setStatus(500, 'Unexpected exception processing request') self.proc.processingError = self.__exception await super().respond(response)
async def respond(self, response: Response) -> None: response.setStatus(500, 'Unexpected exception processing request') response.setContentType('text/plain') response.write('Unexpected exception processing request.\n' 'Details were written to the server log.\n')
async def respond(self, response: Response) -> None: response.setStatus(401, self.__message) response.setHeader('WWW-Authenticate', f'Basic realm="{self.__realm}"')
async def respond(self, response: Response) -> None: response.setStatus(self.__status, self.__message) response.setContentType('text/plain') response.write(self.__message + '\n')
async def respond(self, response: Response) -> None: response.setStatus(500) self.proc.error = self.error await super().respond(response)