Package com.couchbase.client.java.error

Examples of com.couchbase.client.java.error.TranscodingException


            }

            if (ex instanceof TranscodingException) {
                throw (TranscodingException) ex;
            } else {
                throw new TranscodingException("Could not decode document with ID " + id, ex);
            }
        }
    }
View Full Code Here


            return doEncode(document);
        } catch(Exception ex) {
            if (ex instanceof TranscodingException) {
                throw (TranscodingException) ex;
            } else {
                throw new TranscodingException("Could not encode document with ID " + document.id(), ex);
            }
        }
    }
View Full Code Here

    @Override
    protected JsonDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags, ResponseStatus status)
        throws Exception {
        if (!TranscoderUtils.hasJsonFlags(flags)) {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-JSON document for "
                + "id " + id + ", could not decode.");
        }

        JsonObject converted = stringToJsonObject(content.toString(CharsetUtil.UTF_8));
        return newDocument(id, expiry, converted, cas);
View Full Code Here

    @Override
    protected BinaryDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags,
        ResponseStatus status) throws Exception {
        if (!TranscoderUtils.hasBinaryFlags(flags)) {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-binary " +
                "document for id " + id + ", could not decode.");
        }
        return BinaryDocument.create(id, expiry, content, cas);
    }
View Full Code Here

                @Override
                public ClusterInfo call(ClusterConfigResponse response) {
                    try {
                        return new DefaultClusterInfo(CouchbaseAsyncBucket.JSON_OBJECT_TRANSCODER.stringToJsonObject(response.config()));
                    } catch (Exception e) {
                        throw new TranscodingException("Could not decode cluster info.", e);
                    }
                }
            });
    }
View Full Code Here

                                .password(bucket.getString("saslPassword"))
                                .build());
                        }
                        return Observable.from(settings);
                    } catch (Exception e) {
                        throw new TranscodingException("Could not decode cluster info.", e);
                    }
                }
            });
    }
View Full Code Here

TOP

Related Classes of com.couchbase.client.java.error.TranscodingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.