Skip to content

Conversation

@cweitkamp
Copy link
Contributor

  • Added handling for responseType 'LOAD_CANCELLED'

Prevents warnings like these:

2020-05-07 17:00:02.993 [WARN ] [su.litvak.chromecast.api.v2.Channel ] - Error while handling, caused by com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'LOAD_CANCELLED' as a subtype of [simple type, class su.litvak.chromecast.api.v2.StandardResponse]: known type ids = [CLOSE, DEVICE_ADDED, DEVICE_REMOVED, DEVICE_UPDATED, GET_APP_AVAILABILITY, INVALID_REQUEST, LAUNCH_ERROR, LOAD_FAILED, MEDIA_STATUS, MULTIZONE_STATUS, PING, PONG, RECEIVER_STATUS]
 at [Source: (String)"{"requestId":5001,"responseType":"LOAD_CANCELLED","itemId":1}"; line: 1, column: 34]

Signed-off-by: Christoph Weitkamp github@christophweitkamp.de

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Copy link
Owner

@vitalidze vitalidze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. When do you receive such message?

Also, do you mind if I ask you to write unit-test(s) for this case?

StandardResponse.Invalid invalid = (StandardResponse.Invalid) response;
throw new ChromeCastException("Invalid request: " + invalid.reason);
} else if (response instanceof StandardResponse.LoadFailed) {
} else if (response instanceof StandardResponse.LoadCancelled || response instanceof StandardResponse.LoadFailed) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should fall under the different if branch, throwing an error saying that the Load was cancelled. However I am not sure about the use case.

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
@cweitkamp
Copy link
Contributor Author

When do you receive such message?

This warning has been reported in our community: https://community.openhab.org/t/getting-error-playing-mp3-thru-google-assistant/98420

Also, do you mind if I ask you to write unit-test(s) for this case?

In general I would do it but I am afraid my time is very limited at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants