PageRenderTime 17ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/src/mpv5/bugtracker/ExceptionHandler.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 48 lines | 15 code | 4 blank | 29 comment | 0 complexity | d4be389eb6ca16f37c18e1d4996de1bf MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  1. /*
  2. * This file is part of YaBS.
  3. *
  4. * YaBS is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * YaBS is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with YaBS. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. package mpv5.bugtracker;
  18. import java.util.List;
  19. import java.util.Vector;
  20. import mpv5.ui.frames.MPView;
  21. /**
  22. * This class handles unexpected exceptions thrown during the use of Yabs
  23. */
  24. public class ExceptionHandler {
  25. /**
  26. * Notify the ExceptionHandler about a new Exception
  27. * @param exception
  28. */
  29. public static void add(Exception exception) {
  30. exc.add(exception);
  31. // mpv5.YabsViewProxy.instance().showError();
  32. // mpv5.YabsViewProxy.instance().setWaiting(false);//clean up
  33. }
  34. static List<Exception> exc = new Vector<Exception>();
  35. /**
  36. * Returns the Excpetions and flushes the list
  37. * @return A list of Exceptions
  38. */
  39. public static List<Exception> getExceptions() {
  40. Vector<Exception> t = new Vector<Exception>(exc);
  41. exc.clear();
  42. return t;
  43. }
  44. }