exception

How to send Android Crash report using ACRA

匆匆过客 提交于 2019-12-31 10:06:10
问题 Am trying to send crash report from my applicatio to my domain or Mail but failed still. To get the crash report in mail, I did @ReportsCrashes( formKey = "", mailTo = "abc@gmail.com" ) And the response is, Sending file 1372758321000-approved.stacktrace checkAndSendReports - finish To get the crash report in my domain, I did @ReportsCrashes( formKey = "", formUri = "http://www.abc.com/test1" ) And the response is, Sending file 1372856882000-approved.stacktrace Failed to send crash report for

how to save exception in txt file?

浪尽此生 提交于 2019-12-31 09:11:30
问题 public DataTable InsertItemDetails(FeedRetailPL objFeedRetPL) { DataTable GetListID = new DataTable(); try { SqlParameter[] arParams = new SqlParameter[4]; arParams[0] = new SqlParameter("@Date", typeof(DateTime)); arParams[0].Value = objFeedRetPL.requestdate; } catch (Exception ex) { string dir = @"C:\Error.txt"; // folder location if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); File.AppendAllText(Server.MapPath("~/Error.txt"), "Message :" + ex.Message + "<br/>" + Environment

How to make a custom exception class with multiple init args pickleable

孤街浪徒 提交于 2019-12-31 08:28:51
问题 Why does my custom Exception class below not serialize/unserialize correctly using the pickle module? import pickle class MyException(Exception): def __init__(self, arg1, arg2): self.arg1 = arg1 self.arg2 = arg2 super(MyException, self).__init__(arg1) e = MyException("foo", "bar") str = pickle.dumps(e) obj = pickle.loads(str) This code throws the following error: Traceback (most recent call last): File "test.py", line 13, in <module> obj = pickle.loads(str) File "/usr/lib/python2.7/pickle.py"

.NET: How to convert Exception to string?

懵懂的女人 提交于 2019-12-31 08:08:10
问题 When an exception is thrown (while debugging in the IDE), i have the opportunity to view details of the exception: But in code if i call exception.ToString() i do not get to see those useful details: System.Data.SqlClient.SqlException (0x80131904): Could not find stored procedure 'FetchActiveUsers'. [...snip stack trace...] But Visual Studio has some magic where it can copy the exception to the clipboard : Which gives the useful details: System.Data.SqlClient.SqlException was unhandled by

NoSuchElementException after closing system.in

走远了吗. 提交于 2019-12-31 06:40:12
问题 [ Interrupt a thread waiting for user input and then exit the app ] I wanted to do the same exercise as mentioned in the above link. But, I ran into NoSuchElementException when I tried to use inConsole.nextLine() , after successfully closing BufferedReader object , in spite of reassigning inConsole like inConsole = new Scanner(System.in) to read from Standard input. After closing BufferedReader object , can't I reassign to Scanner object like above and use it? 回答1: Never close neither System

Possibly lossy conversion from long to int [duplicate]

家住魔仙堡 提交于 2019-12-31 06:25:28
问题 This question already has answers here : What does “possible lossy conversion” mean and how do I fix it? (1 answer) Java array with more than 4gb elements (11 answers) Closed last year . I am getting "incompatible types: possibly loss of conversion from long to int" exception in this line: boolean arr[] = new boolean [limit]; I don't understand why this is happening since I am storing the input value in long, how is it getting converted to int? import java.util.*; import java.io.*; public

Map JSON to pojo using Jackson for List that have different parameters

时光怂恿深爱的人放手 提交于 2019-12-31 06:17:37
问题 JSON FORMAT: [ { "0": { "cast":"", "showname":"woh pagle", "type":"Episodes" }, "video":[ { "src":"video.mp4" }, { "DRM":"False" } ] } ] Here problem is I am getting below exception: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at [Source: java.io.StringReader@1c9ca1; line: 1, column: 55617] (through reference chain: com.apalya.myplex.valueobject.ThirdPartyContentDetailsArray["video"]) My pojo classes are :

Junit 4.12 Issue testing exception

被刻印的时光 ゝ 提交于 2019-12-31 05:18:06
问题 I have a simple method trying to fetch some file. I would like to test when the file is none existent and this is where my problem begins. The test keeps failing. The method is something like : public Configuration populateConfigs(Configuration config) throws UnRetriableException { try { .... } catch (IOException | ConfigurationException e) { log.error(" getConfiguration : ", e); throw new UnRetriableException(e); } throw new UnRetriableException("problem getting config files."); } In my

Reference .netstandard 2.0 project in core 2.0 Runtime loading error when GenerateAssemblyInfo = false

喜欢而已 提交于 2019-12-31 05:08:05
问题 When we add the reference, we are able to use the .netstandard libs classes in our .net core console project (in Visual Studio), and it compiles. When we run the app, it immediately crashes with this error in the output window: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. Could not load file or assembly 'MyNetStandard20Assembly, Version=0.1.0.0, Culture=en-us, PublicKeyToken=null'. The system cannot find the file specified. Update / Cause (still

Reference .netstandard 2.0 project in core 2.0 Runtime loading error when GenerateAssemblyInfo = false

和自甴很熟 提交于 2019-12-31 05:07:17
问题 When we add the reference, we are able to use the .netstandard libs classes in our .net core console project (in Visual Studio), and it compiles. When we run the app, it immediately crashes with this error in the output window: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. Could not load file or assembly 'MyNetStandard20Assembly, Version=0.1.0.0, Culture=en-us, PublicKeyToken=null'. The system cannot find the file specified. Update / Cause (still