0
A
回答
0
你好charankumar即使我沒有從exception.getLocalizedMessage()
得到任何東西。
所以我用exception.toString()
而不是那個。它會給你類型的Exception
(如NullPointerException
,ClassCastException
,IndexOutOfBoundsException
等)。
另外,如果有一些字符串作爲localizedMessage,它也會返回給你。
0
看看JavaDoc here和here。正如你可以閱讀後者的語義是:
Creates a localized description of this throwable. Subclasses may override
this method in order to produce a locale-specific message. For subclasses
that do not override this method, the default implementation returns the
same result as getMessage()
基本上這意味着你將不得不看看具體的例外,以確定哪些本地化的消息可能或意味着,也是,如果你」重新得到什麼,無論是.getMessage()
也應該返回任何或本地化版本確實覆蓋(或執行不遵守合同,這也極有可能)...
乾杯,
+0
謝謝安德斯.. – JAVAC
相關問題
- 1. 的Hibernate + GWT異常
- 2. GWT 2.5.0編譯器異常
- 3. GWT反序列化異常
- 4. 異常的GWT程序
- 5. GWT序列化異常
- 6. GWT Deobfuscator生成ClassCastException異常
- 7. GWT - RPC序列化異常
- 8. GWT RequestFactory偶爾非法參數異常
- 9. GWT奇怪的序列化異常
- 10. 異常裝載簡單的GWT視圖
- 11. 使用OSM的GWT導致異常
- 12. GWT未捕獲的異常逃逸
- 13. GWT DateTimeFormat.parse始終非法參數異常
- 14. GWT問題,GWT.create(SomeClass.class)拋出異常
- 15. GWT。拋出onFailure()中的異常
- 16. Designer中的奇怪GWT異常
- 17. GWT SoundManager 2播放()拋出異常
- 18. GWT - 拋出異常VS返回null
- 19. 編譯GWT代碼的JavaScript異常
- 20. GWT中拋出的NoSuchMethod異常
- 21. 使用GWT和REST時發生異常
- 22. GWT RPC應用程序中的異常
- 23. 使用GWT處理自定義異常
- 24. 在編譯的GWT中調試異常?
- 25. GWT PhoneGap RPC - 狀態異常0
- 26. 在gwt hibernate程序中的異常
- 27. GWT中的多個JavaScript異常處理
- 28. Gwt Mockito:@RunWith(GwtMockitoTestRunner.class)導致異常
- 29. 序列化GWT RPC的ANTLR異常
- 30. Gwt中不兼容的RemoteService異常?
你說關於'java.lang.Exception.getLocalizedMessage()'? – RAS
是在catch塊e.getLocalizedMessage() – JAVAC