/*
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/*
 * $Id:$
 */
package com.sun.ts.tests.websocket.common.util;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class ErrorEncoder implements Encoder.Text<String> {

    @Override
    public void init(EndpointConfig config) {
    }

    @Override
    public String encode(String data) throws EncodeException {
        throw new EncodeException("Something went horribly wrong", data);
    }

    @Override
    public void destroy() {
    }
}