The trivial work is done :). We should only verify that all the exception related to code error 401-403-404-501 are generated by the lower layer
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@399741 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/GeneralActionListener.java b/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/GeneralActionListener.java
index 2c90817..91cd966 100644
--- a/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/GeneralActionListener.java
+++ b/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/GeneralActionListener.java
@@ -38,7 +38,7 @@
import org.apache.felix.upnp.basedriver.Activator;
import org.apache.felix.upnp.extra.util.Converter;
-import org.apache.felix.upnp.extra.util.UPnPException;
+import org.osgi.service.upnp.UPnPException;
/**
* @author Stefano "Kismet" Lenzi
@@ -107,7 +107,7 @@
outArgs=osgiAct.invoke(inArgs);
} catch (UPnPException e) {
//TODO Activator.logger.log()
- upnpAct.setStatus(e.getErrorCode(),e.getErrorDescription());
+ upnpAct.setStatus(e.getUPnPError_Code(),e.getMessage());
invalidAction=true;
} catch (Exception e){
//TODO Activator.logger.log()
diff --git a/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPActionImpl.java b/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPActionImpl.java
index 7f82fa4..4708015 100644
--- a/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPActionImpl.java
+++ b/org.apache.felix.upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPActionImpl.java
@@ -30,7 +30,7 @@
import org.osgi.service.upnp.UPnPStateVariable;
import org.apache.felix.upnp.extra.util.Converter;
-import org.apache.felix.upnp.extra.util.UPnPException;
+import org.osgi.service.upnp.UPnPException;
/**
* @author Matteo "matted" Demuru
diff --git a/org.apache.felix.upnp.extra/src/main/java/org/apache/felix/upnp/extra/util/UPnPException.java b/org.apache.felix.upnp.extra/src/main/java/org/apache/felix/upnp/extra/util/UPnPException.java
deleted file mode 100644
index 9bdddbd..0000000
--- a/org.apache.felix.upnp.extra/src/main/java/org/apache/felix/upnp/extra/util/UPnPException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * 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 org.apache.felix.upnp.extra.util;
-
-/**
- * @author Stefano "Kismet" Lenzi
- * @author Francesco Furfari
- *
- */
-public class UPnPException extends Exception {
-
- private int errorCode;
-
- public UPnPException(int errorCode, String errorDescription,
- Throwable t) {
- super(errorDescription, t);
- this.errorCode = errorCode;
- }
-
- public UPnPException(int errorCode, String errorDescription) {
- super(errorDescription);
- this.errorCode = errorCode;
- }
-
- public String getErrorDescription() {
- return getMessage();
- }
-
- public int getErrorCode() {
- return errorCode;
- }
-
-}
diff --git a/org.apache.felix.upnp.tester/src/main/java/org/apache/felix/upnp/tester/gui/ActionPanel.java b/org.apache.felix.upnp.tester/src/main/java/org/apache/felix/upnp/tester/gui/ActionPanel.java
index 2c61c99..d44ff36 100644
--- a/org.apache.felix.upnp.tester/src/main/java/org/apache/felix/upnp/tester/gui/ActionPanel.java
+++ b/org.apache.felix.upnp.tester/src/main/java/org/apache/felix/upnp/tester/gui/ActionPanel.java
@@ -44,7 +44,7 @@
import javax.swing.table.TableModel;
import org.apache.felix.upnp.extra.util.Converter;
-import org.apache.felix.upnp.extra.util.UPnPException;
+import org.osgi.service.upnp.UPnPException;
import org.apache.felix.upnp.tester.Mediator;
import org.osgi.service.upnp.UPnPAction;
import org.osgi.service.upnp.UPnPStateVariable;
@@ -107,8 +107,8 @@
catch (UPnPException ex){
String error =
"===== Action Failed =====" +
- "\nUPnP Error Code::\n " +ex.getErrorCode() +
- "\nUPnP Error Description::\n " +ex.getErrorDescription();
+ "\nUPnP Error Code::\n " +ex.getUPnPError_Code() +
+ "\nUPnP Error Description::\n " +ex.getMessage();
printReport(params,error);
JOptionPane.showMessageDialog(
Mediator.getPropertiesViewer(),error);