Skip to content

Commit

Permalink
Merge pull request #376 from ably/fix-deprecation-notice
Browse files Browse the repository at this point in the history
Use exception instead of deprecation notice
  • Loading branch information
funkyboy authored Mar 19, 2018
2 parents 8d4b37d + 87cfda3 commit 063c323
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/src/main/java/io/ably/lib/types/BaseMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,7 @@ public void encode(ChannelOptions opts) throws AblyException {
encoding = ((encoding == null) ? "" : encoding + "/") + "utf-8";
}
} else if(!(data instanceof byte[])) {
if (opts != null && opts.encrypted) {
throw AblyException.fromErrorInfo(new ErrorInfo("Invalid message data or encoding", 400, 40013));
} else {
Log.e(TAG, "Message data must be either `byte[]`, `String` or `JSONElement`; implicit coercion of other types to String is deprecated and throws from v.0.9 on.\nPlease check the documentation (https://www.ably.io/documentation/realtime/types#message).");
}
throw AblyException.fromErrorInfo(new ErrorInfo("Invalid message data or encoding", 400, 40013));
}
}
if (opts != null && opts.encrypted) {
Expand Down

0 comments on commit 063c323

Please sign in to comment.