code: public static String str_exception(Exception except) {
          String str = "";
  
          if (except instanceof ConnectionFailed)
              str += ((ConnectionFailed) (except)).getStack();
          else if (except instanceof CommunicationFailed)
              str += ((CommunicationFailed) (except)).getStack();
          else if (except instanceof WrongNameSyntax)
              str += ((WrongNameSyntax) (except)).getStack();
          else if (except instanceof WrongData)
              str += ((WrongData) (except)).getStack();
          else if (except instanceof NonDbDevice)
              str += ((NonDbDevice) (except)).getStack();
          else if (except instanceof NonSupportedFeature)
              str += ((NonSupportedFeature) (except)).getStack();
          else if (except instanceof EventSystemFailed)
              str += ((EventSystemFailed) (except)).getStack();
          else if (except instanceof AsynReplyNotArrived)
              str += ((AsynReplyNotArrived) (except)).getStack();
          else if (except instanceof DevFailed) {
              DevFailed df = (DevFailed) except;
              //	True DevFailed
              str += "Tango exception  " + df.toString() + "\n";
              for (int i = 0; i < df.errors.length; i++) {
                  str += "Severity -> ";
                  switch (df.errors[i].severity.value()) {
                      case ErrSeverity._WARN:
                          str += "WARNING \n";
                          break;
  
                      case ErrSeverity._ERR:
                          str += "ERROR \n";
                          break;
  
                      case ErrSeverity._PANIC:
                          str += "PANIC \n";
                          break;
  
                      default:
                          str += "Unknown severity code";
                          break;
                  }
                  str += "Desc   -> " + df.errors[i].desc + "\n";
                  str += "Reason -> " + df.errors[i].reason + "\n";
                  str += "Origin -> " + df.errors[i].origin + "\n";
  
                  if (i < df.errors.length - 1)
                      str += "-------------------------------------------------------------\n";
              }
          } else
              str = except.toString();
          return str;
      }
docs: ================================================================