Example #1
0
 void uncaughtType(Type t, Position pos) throws SemanticException {
   SemanticException e =
       new SemanticException(
           codeType
               + " cannot throw a \""
               + t
               + "\"; the exception must either be caught or declared to be thrown.",
           pos);
   Map<String, Object> map = CollectionFactory.newHashMap();
   map.put(CodedErrorInfo.ERROR_CODE_KEY, CodedErrorInfo.ERROR_CODE_SURROUND_THROW);
   map.put("TYPE", t.toString());
   e.setAttributes(map);
   throw e;
 }