def _getpalette():
    try:
        return {'palette': _Console.console.getpalette()}
    except console.NotSupportedError:
        bottle.abort(501, 'Console does not support this function')
    except console.CommunicationError:
        bottle.abort(503, 'Unable to communicate with console')

