/**
 * Copyright 2017-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.rasc.wamp2spring;

/**
 * User exception that can be thrown at procedure invocation
 */
public class WampException extends Exception {

	private final String uri;

	public WampException(String error) {
		this.uri = error;
	}

	public WampException(String error, String message) {
		super(message);
		this.uri = error;
	}

	public WampException(WampError error) {
		this(error.getExternalValue());
	}

	public WampException(WampError error, String message) {
		this(error.getExternalValue(), message);
	}

	public String getUri() {
		return uri;
	}
}

/**
 * Copyright 2017-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.rasc.wamp2spring;

/**
 * User exception that can be thrown at procedure invocation
 */
public class WampException extends Exception {

	private final String uri;

	public WampException(String error) {
		this.uri = error;
	}

	public WampException(String error, String message) {
		super(message);
		this.uri = error;
	}

	public WampException(String error, String message, Throwable cause) {
		super(message, cause);
		this.uri = error;
	}

	public WampException(WampError error) {
		this(error.getExternalValue());
	}

	public WampException(WampError error, String message) {
		this(error.getExternalValue(), message);
	}

	public WampException(WampError error, String message, Throwable cause) {
		this(error.getExternalValue(), message, cause);
	}

	public String getUri() {
		return uri;
	}

	private WampException() {
		uri = null;
	}

	private WampException(Throwable cause) {
		uri = null;
	}
}

Make `uri` parameter mandatory for `WampException`