In opnfv-toscaparer ver 1.0.1, when passing -nrpv to prohibit the input
parameter validation, i.e.
    toscaparser --template-file <file> -nrpv
The exceptions of type MissingRequiredParameterError are still got
raised. Seems that -nrpv parameter is not working.
JIRA: PARSER-181
Change-Id: If44eefcc2b7bdb360eae023ed2c2cd67789c2128
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
 
     @staticmethod
     def removeException(exception_type):
-        if ExceptionCollector.collecting and ExceptionCollector.exceptions:
+        # if ExceptionCollector.collecting and ExceptionCollector.exceptions:
+        if ExceptionCollector.exceptions:
+            tmp_exceptions = []
             for i, e in enumerate(ExceptionCollector.exceptions):
-                if isinstance(e, exception_type):
-                    del ExceptionCollector.exceptions[i]
+                if not isinstance(e, exception_type):
+                    tmp_exceptions.append(e)
+                    # del ExceptionCollector.exceptions[i]
+            ExceptionCollector.exceptions = tmp_exceptions
 
     @staticmethod
     def exceptionsCaught():