How to store an exception

I want to throw an exception and to display it. In my IF block I throw the exception. Do I have to store the exception to pass it as a variable in the method which precedes. if(count !=0) { throw new Exception(); eventLogger.logError("The count is no

How to cut a list

Alright, I am pretty new to programming but I do know that 0-0 == 0. Can anyone explain Why I get this error? I have searched high and low and cannot explain this. Every implementation of slicing that I've seen is done like this (except for using bui

Management of the exceptions imported from the module

How do you handle module specific exceptions in Python? For example, if I wanted to catch an error thrown from the sqlite3 module in python, what would I place in the {} to handle that exception? import sqlite3 try: ... except {}: ... Checking throug

NullPointer exception when using edittext

I wanna store this van values in local host database but it is unfortunately stopped working please help import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpEntity; imp

how does nextLine reject the entry?

I'm a beginner at java. I wanted to know how the nextLine() Method discards your current input? For example assume the following code: Scanner input = new Scanner(System.in); int a = input.nextInt(); input.nextLine(); After the input.nextLine() is ex

JSON Android parsing exception

Hello I am working on a login activity but it always displays the following error: E/JSON Parser(12505): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject 03-25 00:21:14.735: W/dalvikvm(12

ActivityNotFoundException always called for PDF Viewer

I'm having this problem where I'm trying to open a PDF file in my app, if there are no PDF viewers on the device it redirects to the Play Store to download Adobe Reader. However I already downloaded Adobe Reader, it still catches ActivityNotFoundExce

Operate the Handbrake encoder

I am unable to get Handbrake to work for me in C#. It keeps throwing the error "Value cannot be null." . As you can see in the screenshot below, I've tried a couple of things based on what I know. I would appreciate any of your guidance to help

Managing unhandled exceptions in the GUI

I am mostly writing a small tools for tech savvy people, e.g. programmers, engineers etc. As those tools are usually quick hacks improved over time I know that there are going to be unhandled exceptions and the users are not going to mind. I would li

Strange exception on DataBind from the drop-down list

I got an Exception on this code: ddlSalesMgr.SelectedIndex = -1; ddlSalesMgr.SelectedValue = null; ddlSalesMgr.DataBind(); Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentOutOfRangeException: 'ddlSalesMgr' has a

MediaPlayer stops and restarts

I get a weird error. I play with a MediaPlayer a mediastream (like shoutcast or icecast). Sometimes suddenly on playing stream (total random) happens a error, the stream stops and restart. OnErrorListener don't get triggered! Logcat: 03-02 17:50:36.2

c # Exception raised at (not in) constructor

An exception is being thrown at (not in) a constructor call: controller = new Controller(classInstance); // Won't let me step in, exception thrown immediately. The exception description is: System.BadImageFormatException: Could not load file or assem

Simultaneous Edit Exception: Adding to an ArrayList

The problem occurs at Element element = it.next(); And this code which contains that line, is inside of an OnTouchEvent for (Iterator<Element> it = mElements.iterator(); it.hasNext();){ Element element = it.next(); if(touchX > element.mX &&am

How can I turn link errors into execution exceptions?

Just as there is "treat warning as errors" set in our projects to catch early possible problems, I would love to have a runtime exception to catch them early. I have recently been bit by this problem and I would have been glad to have this. Can

nested java for () loop throws ArrayIndexOutOfBoundsException

I'm working through a JPanel exercise in a Java book. I'm tasked with creating a 5x4 grid using GridLayout. When I loop through the container to add panels and buttons, the first add() throws the OOB exception. What am I doing wrong? package mineFiel

Xml deserialization fails on the empty element

I have an Xml document that looks similar too <Reports xmlns=""> <Report> <ReportID>1</ReportID> <ParameterTemplate /> </Report> </Reports> It fails serializing to this object [XmlType(TypeName = "R

How to register contacts in an address book and list them?

I am working on making an address book in C# 2008. I need to be able to save the contacts and then later display them when the user asked for it. I also need to handle an exception when someone enters an unknown color when writing the person's favori