Display Custom Message to Client?

Is there anyway to display a custom message to the client?

 

I've developed a channel which lists various videos even if they're technically not available yet. Trying to view one calls the service which then finds out if the video is available. If it isn't, I raise Ex.MediaNotAvailable which is mentioned somewhere (can't remember where I found it), but on the iOS client, that results in an extremely unhelpful message of "An unknown error occurred -12880".

 

I'd much rather be able to say "This video is not yet available" as you might imagine.

This should do the trick:

 

    return MessageContainer(
        "Video Not Available",
        "This video is not available for viewing yet. Please try again later."
    )

This should do the trick:

 

    return MessageContainer(
        "Video Not Available",
        "This video is not available for viewing yet. Please try again later."
    )

MessageContainer has been deprecated. You can use an ObjectContainer and set the header and message value like this:

return ObjectContainer(
	header = "This is the header",
	message = "This is the message"
)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.