Search Results

Search found 19541 results on 782 pages for 'event handling'.

Page 115/782 | < Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >

  • null reference exception was unhandled by user code

    - by user238319
    sir, i develop the following code in vs2005, now i just using this module in my new project @ vs 2008.. But this error was araised. I cant able to fix this problem... Private Sub DataAccess() Dim errHandle As New ErrorHandler Dim lobjCommon As New eCopsCommonFunctions Try AccessCodeDrplst.DataSource = CType(lobjCommon.gfuncGetAllEnrollmentSource(), DataSet) AccessCodeDrplst.DataValueField = "DataAccessCode" AccessCodeDrplst.DataTextField = "DataAccessDesc" AccessCodeDrplst.DataBind() 'lstEnrollmentSourceCode.DataValueField = "EnrollmentSourceCode" 'lstEnrollmentSourceCode.DataTextField = "EnrollmentSourceDesc" 'lstEnrollmentSourceCode.DataBind() '"Beneficiary Election" is pre selected as default value. By pals on Oct 24th 2007 'lstEnrollmentSourceCode.SelectedValue = "B" 'lstEnrollmentSourceCode.Items.Insert(0, New ListItem("Select", "0")) Catch ex As Exception errHandle.gProcHandleErrors(ex, Session("MemberID"), "SPStatus.aspx.vb, gprocFillSEPCode") Throw ex Finally lobjCommon = Nothing ///here the error occurs as 'NullException was unhandle by the user code' errHandle = Nothing End Try End Sub

    Read the article

  • Throwing exception or retuning value

    - by user274737
    I am using another service in a Service Oriented Architecture. My service used the other service to save data into the database. Is is good practice for me to rethrow the exception which i get from save service or should i catch the exception and encapsulate it in my result and then just send the result back.

    Read the article

  • error handling on browser

    - by godistrue
    hi guys.. presently im developing my own website named justclickme.com this website which is everything works fine but am getting this errror Notice: Undefined variable: body in E:\wamp\www\jcme\email-order-form.php on line 60 here is my code $to = sendmail_single_field_orderform($sessionid,'emailid'); $subject = just click me.'; $body .= "<html><title>SPS Mobile Services</title></body>";->here only am getting error $body .= "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"; can any one help me thanks

    Read the article

  • What is the best way to log errors in Zend Framework in my project at this stage?

    - by Pasta
    We built an app in Zend Framework and have not worked a lot in setting up error reporting and logging. Is there any way we could get some level or error reporting without too much change in the code? Is there a ErrorHandler plugin available? The basic requirement is to log errors that happens within the controller, missing controllers, malformed URLs, etc. I also want to be able to log errors within my controllers. Will using error controller here, help me identify and log errors within my controllers? How best to do this with minimal changes?

    Read the article

  • why cannot use uncaught_exception in dtor?

    - by camino
    Hi , Herb Sutter in his article http://www.gotw.ca/gotw/047.htm pointed out that we cannot use uncaught_exception in desturctor function, // Why the wrong solution is wrong // U::~U() { try { T t; // do work } catch( ... ) { // clean up } } If a U object is destroyed due to stack unwinding during to exception propagation, T::~T will fail to use the "code that could throw" path even though it safely could. but I write a test program, and T::~T in fact didn't use the "code that could throw" #include <exception> #include <iostream> using namespace std; class T { public: ~T() { if( !std::uncaught_exception() ) { cout<<"can throw"<<endl; throw 1; } else { cout<<"cannot throw"<<endl; } } }; struct U { ~U() { try { T t; } catch( ... ) { } } }; void f() { U u; throw 2; } int main() { try { f(); } catch(...) {} } output is : cannot throw did I miss something? Thanks

    Read the article

  • catching erros and exiting

    - by apple pie
    In python, is there a way to exit a class after testing a condition, without exiting out of python? say i have the class class test(): def __init__(self): self.a = 2 def create_b(self): self.b = 3 def does_b_exist(self): if <self.b doesnt exist>: #terminate self.b += 1 try/except` doesnt work since the rest of the program doesnt terminate after failing. im basically trying to catch an error, and do what python does when it shows you errors, but i cant figure out how to do it

    Read the article

  • Excel VBA: Error Handling with Case Statement

    - by AME
    I am trying to validate a file that is uploaded by the user using the code below. The error handler checks the top row of the uploaded file for three specific column names. If one or more of the column names is not present, the program should return a prompt to the user notifying them which column(s) are missing from the file that they uploaded and then close the file. There are a couple issues with my current VBA code that I am seeking help with: The prompt doesn't specify which column(s) are missing to the user. The error handler is triggered even when all required columns are present in the uploaded file. Code: Sub getworkbook() ' Get workbook... Dim ws As Worksheet Dim filter As String Dim targetWorkbook As Workbook, wb As Workbook Dim Ret As Variant Set targetWorkbook = Application.ActiveWorkbook ' get the customer workbook filter = ".xlsx,.xls" caption = "Please select an input file " Ret = Application.GetOpenFilename(filter, , caption) If Ret = False Then Exit Sub Set wb = Workbooks.Open(Ret) On Error GoTo ErrorLine: 'Check for columns var1 = ActiveSheet.Range("1:1").Find("variable1", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column var2 = ActiveSheet.Range("1:1").Find("variable2", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column var3 = ActiveSheet.Range("1:1").Find("variable3", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column ErrorLine: MsgBox ("The selected file is missing a key data column, please upload a correctly formated file.") If Error = True Then ActiveWorkSheet.Close wb.Sheets(1).Move Before:=targetWorkbook.Sheets("Worksheet2") ActiveSheet.Name = "DATA" End Sub

    Read the article

  • android layout-land and screen-rotation handling

    - by davs
    I have layouts for portrait mode (in folder layout) and for landscape one (in the folder layout-land). This screen is located under one of the tabs, so I had to handle screen rotating (after screen has been rotated, no default screen restart occurs). I would like to update view from 'layout-land' when screen rotates to landscape mode and from 'layout' when screen rotates to portrait one. How can I do this?

    Read the article

  • How to prevent users from typing incorrect inputs ?

    - by ZaZu
    Hello, I want the program to loop a scan function if the user types anything else other than numbers.. My code is : do{ printf("Enter rows\n"); scanf("%d",&row); }while(row>='a' && row<='z'); but this code doesnt work .. I keep getting an error when typing in a letter. I tried manipulating around it and the whole thing loops infinitely ... What am I doing wrong ? Please help thanks !

    Read the article

  • How can a client gracefully detect when a server disconnects?

    - by Ummar
    I am working on a client-server application. The client continuously reads data from server, so when a server is closed or disconnects then the client crashes. I tried a try/catch block, but it didn't work. My client application is written in C++. I want the client to display some proper message like "Server disconnected," then exit.

    Read the article

  • How to further improve error messages in Scala parser-combinator based parsers?

    - by rse
    I've coded a parser based on Scala parser combinators: class SxmlParser extends RegexParsers with ImplicitConversions with PackratParsers { [...] lazy val document: PackratParser[AstNodeDocument] = ((procinst | element | comment | cdata | whitespace | text)*) ^^ { AstNodeDocument(_) } [...] } object SxmlParser { def parse(text: String): AstNodeDocument = { var ast = AstNodeDocument() val parser = new SxmlParser() val result = parser.parseAll(parser.document, new CharArrayReader(text.toArray)) result match { case parser.Success(x, _) => ast = x case parser.NoSuccess(err, next) => { tool.die("failed to parse SXML input " + "(line " + next.pos.line + ", column " + next.pos.column + "):\n" + err + "\n" + next.pos.longString) } } ast } } Usually the resulting parsing error messages are rather nice. But sometimes it becomes just sxml: ERROR: failed to parse SXML input (line 32, column 1): `"' expected but `' found ^ This happens if a quote characters is not closed and the parser reaches the EOT. What I would like to see here is (1) what production the parser was in when it expected the '"' (I've multiple ones) and (2) where in the input this production started parsing (which is an indicator where the opening quote is in the input). Does anybody know how I can improve the error messages and include more information about the actual internal parsing state when the error happens (perhaps something like a production rule stacktrace or whatever can be given reasonably here to better identify the error location). BTW, the above "line 32, column 1" is actually the EOT position and hence of no use here, of course.

    Read the article

  • following code comipling perfectly but showing runtime error . why?

    - by user323422
    //sample.h int calci(int &value) { if(value < 20) throw value; else return value; } class XYX { int m_x; public: XYZ(int &x)try:m_x(a-calci(x)) { }catch (int &a) {} }; class ABC { int m_a; public: ABC():m_a(0) { } void foo() { XYZ xyz(10); } }; int main() { ABC abc; abc.foo(); } //if i replace foo() with following code then it works well void foo() { try{ XYZ xyz(10); }catch(...){} }

    Read the article

  • Reading data file into an array C#

    - by Whitey
    I have an array like this: int[,] iMap = new int[iMapHeight, iMapWidth] { { 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, { 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 1, 1, 1, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }; And I want the same thing coming from a data file. The file should be structured like this preferably: 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 0000000000000000000000000 Which will ultimately make an array like above with all values set to 0. What would be the best way to do this? Would I read one line from the file and then split each characters separately and transfer it to the new array? Or perhaps read a line, and then read each character and put that in the array? Thanks for any help.

    Read the article

  • Is catching NumberFormatException a bad practice?

    - by integeruser
    I have to parse a String that can assume hex values or other non-hex values 0xff, 0x31 or A, PC, label, and so on. I use this code to divide the two cases: String input = readInput(); try { int hex = Integer.decode(input); // use hex ... } catch (NumberFormatException e) { // input is not a hex, continue parsing } Can this code be considered "ugly" or difficult to read? Are there other (maybe more elegant) solutions? EDIT : I want to clarify that (in my case) a wrong input doesn't exist: i just need to distinguish if it is a hex number, or not. And just for completeness, i'm making a simple assebler for DCPU-16.

    Read the article

  • Event handling C# / Registering a callback

    - by Jeff Dahmer
    Events can only return void and recieve object sender/eventargs right? If so then craptastic.... how can I pass a function pointer to another obj, like: public bool ACallBackFunc(int n) { return n > 0; } public void RegisterCallback(Something s) { s.GiveCallBack(this.ACallBackFunc); } Something::GiveCallBack(Action? funcPtr) I tried using Action, but I need it to return some value and Actions can only return void. Also, we do not know what kind of a callback we will be recieving; it could return anything and have any params! Reflection will have to be used somehow I reckon.

    Read the article

  • how to disable an onclick event?

    - by user1819709
    <form id="QandA" action="<?php echo htmlentities($action); ?>" method="post"> <table id="question"> <tr> <td colspan="2"> <a onclick="return plusbutton();"> <img src="Images/plussign.jpg" width="30" height="30" alt="Look Up Previous Question" class="plusimage" id="mainPlusbutton" name="plusbuttonrow"/> </a> <span id="plussignmsg">(Click Plus Sign to look up Previous Questions)</span> </td> </tr> </table> </form> In the code above I am able to replace an image with another image when the if statement is met. But my problem is that when the image is replaced, it does not disable the on click event. My question is that when the image is replaced, how do I disable the onclick event onclick="return plusbutton();?

    Read the article

  • fieldWithErrors not wrapping every error field

    - by Teef L
    Notice the following result when I submit blank :title and :description fields The validations are in the controller: class Question < ActiveRecord::Base validates_presence_of :title validates_presence_of :description And, the form is generated with those names: -form_for(@question) do |f| = f.error_messages = f.label :title = f.text_field :title, :size => 50, :onchange => remote_function(:url => {:action => :display_tag_suggestions}, :with => 'Form.Element.serialize(this)') #suggestions = f.label :description = f.text_area :description ... But, for some reason, only :title gets wrapped in the error div tags: <form action="/questions" class="new_question" id="new_question" method="post"> <div style="margin:0;padding:0"><input name="authenticity_token" type="hidden" value="6HQaiu1D0gBQcKw2pLeZP6Jvn0FSClPD5Sk9HwegzPg=" /></div> <div class="errorExplanation" id="errorExplanation"> <h2>2 errors prohibited this question from being saved</h2> <p>There were problems with the following fields:</p> <ul> <li>Title can't be blank</li> <li>Description can't be blank</li> </ul> </div> <label for="question_title">Title</label> <div class="fieldWithErrors"><input id="question_title" name="question[title]" onchange="new Ajax.Request('/questions/display_tag_suggestions', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(this) + '&amp;authenticity_token=' + encodeURIComponent('6HQaiu1D0gBQcKw2pLeZP6Jvn0FSClPD5Sk9HwegzPg=')})" size="50" type="text" value="" /></div> <label for="question_description">Description</label> <textarea cols="40" id="question_description" name="question[description]" rows="20"></textarea> ... I don't think that behavior is expected. The problem most people have is that it's wrapping things with divs, which won't display properly. My problem is that fields aren't being wrapped with divs to begin with! I haven't made any (conscious) changes to how errors are handled, so I'm not sure why it's not working properly.

    Read the article

  • When does the @ become usefull?

    - by DaNieL
    As you know, the @ characters before a php istruction suppress every eventual warning, error or notice from being raised. Personally, i dont like this tecnique, becose i prefer to handle those errors, and in a real life, the error must no happen or have to be managed. By the way, i find this tecnique to be applied in many scripts (cms plugins, open-source classes). So, could the @ really be usefull (in this case, an example would be appreciated), or is just for lazy developers?

    Read the article

  • Handling Email Bouncebacks in Rails

    - by aressidi
    Hi there, I've built a very basic CRM system for my rails app that allows me to send weekly user activity digests with custom text and create multi-part marketing messages which I can configure and send through a basic admin interface. I'm happy with what I've put together on the send-side of things (minus the fact that I haven't tried to volume test its capabilities), but I'm concerned about how to handle bounce-backs. I came across this plugin with associated scripts: http://github.com/kovyrin/bounces-handler I'm using Google Apps to handle my mail and really don't know enough about Perl to want to mess with the above plugin - I have enough headaches. I'm looking for a simple solution for processing bounce-backs in Rails. All my email will go out from an address like this which will be managed in Google Apps: "[email protected]." What's the best workflow for this? Can anyone post an example solution they're using keeping in mind the fact that I'm using Google Apps for the mail? Any guidance, links, or basic workflow best-practices to handle this would be greatly appreciated. Thanks! -A

    Read the article

  • NSIS- Error handling

    - by Pia
    I have written an installer and uninstaller in NSIS which creates and drops an sql database, which is working fine. I have written some .bat and .sql files to create and drop the database and then just call these files from NSIS script. My problem is if I keep this database open in SQL Server Management Studio and run the uninstaller ideally it should give an error message that the database is opened. In my case it shows the success message of uninstaller but dosnt drop the database properly. How can I handle this error in NSIS?

    Read the article

  • Why does my SQL database not work in Android?

    - by user1426967
    In my app a click on an image button brings you to the gallery. After clicking on an image I want to call onActivityResult to store the image path. But it does not work. In my LogCat it always tells me that it crashes when it tries to save the image path. Can you find the problem? My onActivityResult method: mImageRowId = savedInstanceState != null ? savedInstanceState.getLong(ImageAdapter.KEY_ROWID) : null; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(requestCode == PICK_FROM_FILE && data != null && data.getData() != null) { Uri uri = data.getData(); if(uri != null) { Cursor cursor = getContentResolver().query(uri, new String[] { android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null); cursor.moveToFirst(); String image = cursor.getString(0); cursor.close(); if(image != null) { // HERE IS WHERE I WANT TO SAVE THE IMAGE. HERE MUST BE THE ERROR! if (mImageRowId == null) { long id = mImageHelper.createImage(image); if (id > 0) { mImageRowId = id; } } // Set the image and display it in the edit activity Bitmap bitmap = BitmapFactory.decodeFile(image); mImageButton.setImageBitmap(bitmap); } } } } This is my onSaveInstanceState method: private static final Long DEF_ROW_ID = 0L; @Override protected void onSaveInstanceState(Bundle outState) { outState.putLong(ImageAdapter.KEY_ROWID, mImageRowId != null ? mImageRowId : DEF_ROW_ID); super.onSaveInstanceState(outState); } This is a part from my DbAdapter: public long createImage(String image) { ContentValues cv = new ContentValues(); cv.put(KEY_IMAGE, image); return mImageDb.insert(DATABASE_TABLE, null, cv); }

    Read the article

< Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >