Search Results

Search found 52528 results on 2102 pages for 'error'.

Page 5/2102 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Error handling in PHP

    - by Industrial
    Hi guys, We're building a PHP app based on Good old MVC (codeigniter framework) and have run into trouble with a massive chained action that consists of multiple model calls, that together is a part of a big transaction to the database. We want to be able to do a list of actions and get a status report of each one back from the function, whatever the outcome is. Our first initial idea was to utilize the exceptions of PHP5, but since we want to also need status messages that doesnt break the execution of the script, this was our solution that we came up with. It goes a little something like this: $sku = $this->addSku( $name ); if ($sku === false) { $status[] = 'Something gone terrible wrong'; $this->db->trans_rollback(); return $status; } $image= $this->addImage( $filename); if ($image=== false) { $error[] = 'Image could not be uploaded, check filesize'; $this->db->trans_rollback(); return $status; } Our controller looks like this: $var = $this->products->addProductGroup($array); if (is_array($var)) { foreach ($var as $error) { echo $error . '<br />'; } } It appears to be a very fragile solution to do what we need, but it's neither scalable, neither effective when compared to pure PHP exceptions for instance. Is this really the way that this kind of stuff generally is handled in MVC based apps? Thanks!

    Read the article

  • PHP MVC error handling, view display and user permissions

    - by cen
    I am building a moderation panel from scratch in a MVC approach and a lot of questions cropped up during development. I would like to hear from others how they handle these situations. Error handling Should you handle an error inside the class method or should the method return something anyway and you handle the error in controller? What about PDO exceptions, how to handle them? For example, let's say we have a method that returns true if the user exists in a table and false if he does not exist. What do you return in the catch statement? You can't just return false because then the controller assumes that everything is alright while the truth is that something must be seriously broken. Displaying the error from the method completely breaks the whole design. Maybe a page redirect inside the method? The proper way to show a view The controller right now looks something like this: include('view/header.php'); if ($_GET['m']=='something') include('view/something.php'); elseif ($_GET['m']=='somethingelse') include('view/somethingelse.php'); include('view/foter.php'); Each view also checks if it was included from the index page to prevent it being accessed directly. There is a view file for each different document body. Is this way of including different views ok or is there a more proper way? Managing user rights Each user has his own rights, what he can see and what he can do. Which part of the system should verify that user has the permission to see the view, controller or view itself? Right now I do permission checks directly in the view because each view can contain several forms that require different permissions and I would need to make a seperate file for each of them if it was put in the controller. I also have to re-check for the permissions everytime a form is submitted because form data can be easily forged. The truth is, all this permission checking and validating the inputs just turns the controller into a huge if/then/else cluster. I feel like 90% of the time I am doing error checks/permissions/validations and very little of the actual logic. Is this normal even for popular frameworks?

    Read the article

  • Good SQL error handling in Strored Procedure

    - by developerit
    When writing SQL procedures, it is really important to handle errors cautiously. Having that in mind will probably save your efforts, time and money. I have been working with MS-SQL 2000 and MS-SQL 2005 (I have not got the opportunity to work with MS-SQL 2008 yet) for many years now and I want to share with you how I handle errors in T-SQL Stored Procedure. This code has been working for many years now without a hitch. N.B.: As antoher "best pratice", I suggest using only ONE level of TRY … CATCH and only ONE level of TRANSACTION encapsulation, as doing otherwise may not be 100% sure. BEGIN TRANSACTION; BEGIN TRY -- Code in transaction go here COMMIT TRANSACTION; END TRY BEGIN CATCH -- Rollback on error ROLLBACK TRANSACTION; -- Raise the error with the appropriate message and error severity DECLARE @ErrMsg nvarchar(4000), @ErrSeverity int; SELECT @ErrMsg = ERROR_MESSAGE(), @ErrSeverity = ERROR_SEVERITY(); RAISERROR(@ErrMsg, @ErrSeverity, 1); END CATCH; In conclusion, I will just mention that I have been using this code with .NET 2.0 and .NET 3.5 and it works like a charm. The .NET TDS parser throws back a SQLException which is ideal to work with.

    Read the article

  • WPF Application doesn't work on some machines: Stopped working error

    - by Hun1Ahpu
    My WPF application works fine on a number of machines, but now I get a report about this error on a user machine: Description: Stopped working Problem signature: Problem Event Name: CLR20r3 Problem Signature 01: mysoftware.exe Problem Signature 02: 1.0.0.1 Problem Signature 03: 4bbcd9d9 Problem Signature 04: PresentationFramework Problem Signature 05: 3.0.0.0 Problem Signature 06: 4a174fbc Problem Signature 07: 624f Problem Signature 08: e1 Problem Signature 09: System.Windows.Markup.XamlParse OS Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033 I was trying to catch Exception using Application DispatcherUnhandledException but this didn't help. And warping Window1 constructor in try/catch block too. .NET Framework 3.5 is installed on that machine. How can I figure out the reason of crashing: log this error, debug, ...?

    Read the article

  • mySQL: Select WHERE causes error - why?

    - by Industrial
    Hi everybody, I have this query: SELECT `manufacturers`.*, `languages`.*, COUNT(`products`.`id`) AS productcount FROM (`manufacturers`) WHERE manufacturers.flushed = 0 JOIN `languages` ON `manufacturers`.`lang` = `languages`.`id` LEFT OUTER JOIN `products` ON `products`.`manuf` = `manufacturers`.`mid` GROUP BY manufacturers.id ORDER BY `languages`.`id` asc, `manufacturers`.`mid` asc; Without the WHERE row, everything works great, but with it, I get a Error 1064 (Syntax error) thrown in my face. I guess that it has something to do with the actual placement of the WHERE row in the query, so I tried to move it around, but without any luck. What can I do?

    Read the article

  • Cannot reinstall MySql in 11.10 - ERROR: There's not enough space in /var/lib/mysql/

    - by Robin McCain
    I've tried it all (removing all the packages associated with MySQL) but keep getting stuff like this: Preconfiguring packages ... (Reading database ... 142196 files and directories currently installed.) Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.63-0ubuntu0.11.10.1_amd64.deb) ... ERROR: There's not enough space in /var/lib/mysql/ dpkg: error processing /var/cache/apt/archives/mysql-server-5.1_5.1.63-0ubuntu0.11.10.1_amd64.deb (--unpack): subprocess new pre-installation script returned error exit status 1 Errors were encountered while processing: /var/cache/apt/archives/mysql-server-5.1_5.1.63-0ubuntu0.11.10.1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Here is my drive space map. root@kyle:/# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/kyle-root 59361428 59021768 0 100% / udev 1014052 8 1014044 1% /dev tmpfs 409304 1476 407828 1% /run none 5120 0 5120 0% /run/lock none 1023256 0 1023256 0% /run/shm /dev/sda1 233191 46888 173862 22% /boot /dev/md0 1922858288 1048513192 776669500 58% /media/array The root volume actually only has about 10 gigabytes in use on the hard drive (which has a 60 gig partition). /dev/md0 is a 2 TB raid array.

    Read the article

  • Displaying Datamatrix in application error screen

    - by DaveNay
    Quite often we will get a report from a user in the field saying there was an error in our application. Frequently this leads to the typical round of "What was the error?" "I don't know, it was just an error." We of course log these faults to the log files, and we can even enable detailed debug logs, but this involves the end user changing a setting in the configuration file and then finding the correct files and then emailing them to us. As I'm sure you can all imagine, there are plenty of pitfalls and alligators in this methodology. Recently a couple of people have used their cell phone to email me a "screen capture" of the fault, and while this helps, we still have to scrutinize the image to find the exact fault, and if enabled, the stack trace. So this evening, I had the brilliant idea (IMHO) to encode the fault into a Datamatrix barcode image and then encourage users to send me a picture from their cell phone. I can then decode the datamatrix and get a parse-able error message! Our core technology is machine vision, so the decoding of the datamatrix image would be trivial, I just need to find a method of generating the actual image to display in the fault handler. Thoughts?

    Read the article

  • Displaying Datamatrix in application error screen

    - by DaveNay
    Quite often we will get a report from a user in the field saying there was an error in our application. Frequently this leads to the typical round of "What was the error?" "I don't know, it was just an error." We of course log these faults to the log files, and we can even enable detailed debug logs, but this involves the end user changing a setting in the configuration file and then finding the correct files and then emailing them to us. As I'm sure you can all imagine, there are plenty of pitfalls and alligators in this methodology. Recently a couple of people have used their cell phone to email me a "screen capture" of the fault, and while this helps, we still have to scrutinize the image to find the exact fault, and if enabled, the stack trace. So this evening, I had the brilliant idea (IMHO) to encode the fault into a Datamatrix barcode image and then encourage users to send me a picture from their cell phone. I can then decode the datamatrix and get a parse-able error message! Our core technology is machine vision, so the decoding of the datamatrix image would be trivial, I just need to find a method of generating the actual image to display in the fault handler. Thoughts?

    Read the article

  • SQL SERVER – FIX : ERROR : 4214 BACKUP LOG cannot be performed because there is no current database

    - by pinaldave
    I recently got following email from one of the reader. Hi Pinal, Even thought my database is in full recovery mode when I try to take log backup I am getting following error. BACKUP LOG cannot be performed because there is no current database backup. (Microsoft.SqlServer.Smo) How to fix it? Thanks, [name and email removed as requested] Solution / Fix: This error can happen when you have never taken full backup of your database and you try to attempt to take backup of the log only. Take full backup once and attempt to take log back up. If the name of your database is MyTestDB follow procedure as following. BACKUP DATABASE [MyTestDB] TO DISK = N'C:\MyTestDB.bak' GO BACKUP LOG [MyTestDB] TO DISK = N'C:\MyTestDB.bak' GO Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Error Messages, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Log

    Read the article

  • Different callbacks for error or error as first argument?

    - by Florian Margaine
    We (and the JS SO chat room) had a talk with @rlemon some days ago about his Little-XHR library about error handling. Basically, we wanted to decide which error handling pattern should be used: xhr.get({ // Some parameters, and then success: function(data) {}, failure: function(data) {} }) Or: xhr.get({ // Some parameters, and then callback: function(err, data) {} }) One is more jQuery-like, while the other is more Node-like. Some say that the first pattern makes you think more about handling error. I think the opposite, since you may forget the other callback function, while the argument is always there on the second pattern. Any opinion/advantage/drawback about both these patterns?

    Read the article

  • Translating error messages from an external API?

    - by Jan Fabry
    If I am localizing a piece of software that uses an external API, how should I handle error messages that originate in this API? I do not control the API, I only consume it. The error responses are not very structured: some contain error codes, some contain verbose details in the text, others almost nothing. Some errors can be fixed by the user (incorrect configuration), some are caused by the external service (server overload), some could be caused by a bug in my software (of course, this would be very unlikely...). I would like to provide a smooth experience to my end-users, so they know what went wrong and what they can do to fix it. What is the best strategy to use here? (This is a generalization of a question from the WordPress Stack Exchange. I thought it would be worth re-asking here, because it is not limited to WordPress plugins.)

    Read the article

  • System Error Report /usr/bin/Xorg

    - by jimirings
    I have recently begun getting a System Error Report message when I start up my computer. I haven't installed anything recently other than the usual updates or done anything else out of the ordinary. The details for the report just say "/usr/bin/Xorg". It doesn't seem to be causing me any problems beyond the annoying error message. I saw these questions regarding this problem: System Error Report - Xorg How do I enable or disable Apport? That's all dandy for getting the message to go away, but I'd rather fix the problem. Any ideas how I can make that happen? I'm running Ubuntu 12.04 on a Toshiba NB505. I am, of course, happy to provide any other relevant information that may be needed. Thanks in advance.

    Read the article

  • error: you need to load kernel first

    - by Angelos318
    I made a clean install on my Sony Vaio laptop, of Ubuntu 11.10 and when the installation was ready, it prompted to remove the usb I was installing the distro from, and press enter to reboot. After this reboot the first thing I got was the following error: error: couldn't read file error: you need to load the kernel first Press any key to continue.. After that it throws me back to the Grub select screen: Ubuntu, with linux 3.0.0-14-generic-pae recovery mode previous linux versions (none since I made a clean install) memory test If i choose the first option it shows only a black screen and never loads anything. If i reboot the same thing happens. Could I repair this using boot-repair? Is there any other way? Note: I know nothing about linux code so i am a total noob on this one Update: boot-repair did not help Grub.cfg here: http://pastebin.com/GKLuDuhM Boot Info Script: http://pastebin.com/indARkKJ

    Read the article

  • dpkg reports error on package icaclient

    - by Photonics1
    I installed the icaclient (it's a client for Citrix) a while back. I don't exactly remember what I did to get it working but it was enervating. I had to install some old packages not even avaiable for ubuntu (12.04) and in the end I used some stuff from old rpms. Anyway the client is more or less working now but I always get a dpkg error when installing or updating something. The (translated) error message is something like: dpkg: Error while processing icaclient:i386 (--configure): subprocess installed post-installation-script return errorcode 2 I just want to tell dpkg to ignore this or remove this post-install-script but I don't know how. Thanks!

    Read the article

  • New to Java Programming - Error help

    - by JJJ
    I am going through a Java book and drafting the examples and have run into the following error when compiling this code. Any help would be appreciated thank you. Error: Main.java:3: class Addition is public, should be declared in a file named Addition.java public class Addition        ^ 1 error Code: import java.io.*; import java.util.Scanner; public class Addition {   public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in);  int number1; int number2; int sum; System.out.print( "Enter first digit: " ); number1 = input.nextInt(); System.out.print( "Enter second digit:" ); number2 = input.nextInt(); sum = number1 + number2; System.out.printf( "Sum is %d\n, sum" );      } }

    Read the article

  • Hard disk error

    - by Nadim A. Hachem
    I got this error during installation. "The installer encountered an error copying files to the hard disk: [Errno 5] Input/output error This is often due to a faulty CD/DVD disk or drive, or a faulty hard disk. It may help to clean the CD/DVD, to burn the CD/DVD at a lower speed, to clean the CD/DVD drive lens (cleaning kits are often available from electronics suppliers), to check whether the hard disk is old and in need of replacement, or to move the system to a cooler environment." how can i fix this and what does it mean specifically? i'm installing via usb so it can't be the CD. the laptop is recent so it cant be an old HD.

    Read the article

  • Get more error information from unhandled error

    - by Andrew Simpson
    I am using C# in a desktop application. I am calling a DLL written in C that I do not have the source code for. Whenever I call this DLL I get an untrapped error which I trap in an UnhandledException event/delegate. The error is : object reference not set to an instance of an object But the stack trace is empty. When I Googled this the info back was that the error was being hanlded eleswhere and then rethrown. But this can only be in the DLL I do not have the source code for. So, is there anyway I can get more info about this error? This is my code... in program.cs... AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { try { Exception _ex = (Exception)e.ExceptionObject; //the stact trace property is empty here.. } finally { Application.Exit(); } } My DLL... [DllImport("AutoSearchDevice.dll", EntryPoint = "Start", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)] public static extern int Start(int ASD_HANDLE); An I call it like so: public static void AutoSearchStart() { try { Start(m_pASD); } catch (Exception ex) { } }

    Read the article

  • postgres - ERROR: syntax error at or near "COST"

    - by cino21122
    EDIT Taking COST 100 out made the command go through, however, I'm still unable to run my query because it yields this error: ERROR: function group_concat(character) does not exist HINT: No function matches the given name and argument types. You may need to add explicit type casts. The query I'm running is this: select tpid, group_concat(z) as z, group_concat(cast(r as char(2))) as r, group_concat(to_char(datecreated,'DD-Mon-YYYY HH12:MI am')) as datecreated, group_concat(to_char(datemodified,'DD-Mon-YYYY HH12:MI am')) as datemodified from tpids group by tpid order by tpid, zip This function seems to work fine locally, but moving it online yields this error... Is there something I'm missing? CREATE OR REPLACE FUNCTION group_concat(text, text) RETURNS text AS $BODY$ SELECT CASE WHEN $2 IS NULL THEN $1 WHEN $1 IS NULL THEN $2 ELSE $1 operator(pg_catalog.||) ',' operator(pg_catalog.||) $2 END $BODY$ LANGUAGE 'sql' IMMUTABLE COST 100; ALTER FUNCTION group_concat(text, text) OWNER TO j76dd3;

    Read the article

  • Access Error when running windows program

    - by JPJedi
    I have a windows form application that uses microsoft access for the database on the backend. When I run that application I get an error that says access is not installed on the computer. I thought that if I included the reference that it will be included with what I release so the user would not have to have access installed. How do I include the Access Runtime to be distributed/installed when my application is installed?

    Read the article

  • How to number JSF error messages and attach number to invalid component

    - by Pich
    I want to number any JSF error messages (e.g. validation, conversion messages) that appears if a user enters invalid input in a couple of input fields. For example like this when the user sends the form: Name cannot contain numbers E-mail is incorrect ----- Form ------ (1) Name: John 13 Doe Age: 30 (2) E-mail: myemail@domain How can I do this? Best regards

    Read the article

  • MIME/IMF error codes?

    - by hack.augusto
    I need to write php code to identify common e-mail errors, like "inbox full" or specially "invalid email name" from email messages, because we need to clear our databases from nonexistent emails. I'm looking the MIME and IMF formats but I didn't find any kind of standard error code, does it exist?

    Read the article

  • SQL SERVER – Fix : Error 3623 – An invalid floating point operation occurred

    - by pinaldave
    Going back in time, I always had a problem with mathematics. It was a great subject and I loved it a lot but I only mastered it after practices a lot. I learned that mathematics problems should be addressed systematically and being verbose is not a trick, I learned to solve any problem. Recently one of reader sent me an email with the title “Mathematics problem – please help!” and I was a bit scared. I was good at mathematics but not the best. When I opened the email I was relieved as it was Mathematics problem with SQL Server. My friend received following error while working with SQL Server. Msg 3623, Level 16, State 1, Line 1 An invalid floating point operation occurred. The reasons for the error is simply that invalid usage of the mathematical function is attempted. Let me give you a few examples of the same. SELECT SQRT(-5); SELECT ACOS(-3); SELECT LOG(-9); If you run any of the above functions they will give you an error related to invalid floating point. Honestly there is no workaround except passing the function appropriate values. SQRT of a negative number will give you result in real numbers which is not supported at this point of time as well LOG of a negative number is not possible (because logarithm is the inverse function of an exponential function and the exponential function is NEVER negative). When I send above reply to my friend he did understand that he was passing incorrect value to the function. As mentioned earlier the only way to fix this issue is finding incorrect value and avoid passing it to the function. Every mathematics function is different and there is not a single solution to identify erroneous value passed. If you are facing this error and not able to figure out the solution. Post a comment and I will do my best to figure out the solution. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • What Error Messages Reveal

    - by ultan o'broin
    I love this blog entry Usability doesn't mean UI Especially the part: Ask for a list of all error messages when you do your next vendor evaluation. You will learn more about the vendor's commitment to usability and product quality than you will fathom from a slick demo. Not so sure about the part about error messages not being "hip" or "glamorous" though. I know... I should get out more...:)

    Read the article

  • apt-get error, cannot install many packages?

    - by tech
    How do I fix this? It shows an error, and I don't know how to fix it. I want to install crossover. Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... failed. The following packages have unmet dependencies: crossover:i386 : Depends: libc6:i386 (>= 2.3) but it is not installed Depends: libice6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libsm6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libx11-6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libxext6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libfreetype6:i386 but it is not installed Depends: libz1:i386 Depends: perl5-base:i386 Depends: perl-modules:i386 but it is not installable Depends: python:i386 (>= 2.4) but it is not installed Depends: python-gtk2:i386 but it is not installed Depends: python-glade2:i386 but it is not installed Depends: desktop-file-utils:i386 but it is not installed Depends: libasound2:i386 but it is not installed Depends: libgl1:i386 Depends: libxrandr2:i386 but it is not installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. E: Unable to correct dependencies EDIT I have another recent error. You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: crossover:i386 : Depends: libc6:i386 (= 2.3) but it is not installed Depends: libice6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libsm6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libx11-6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libxext6:i386 but it is not installed or xlibs:i386 but it is not installable Depends: libfreetype6:i386 but it is not installed Depends: libz1:i386 Depends: perl5-base:i386 Depends: perl-modules:i386 but it is not installable Depends: python:i386 (= 2.4) but it is not installed Depends: python-gtk2:i386 but it is not installed Depends: python-glade2:i386 but it is not installed Depends: desktop-file-utils:i386 but it is not installed Depends: libasound2:i386 but it is not installed Depends: libgl1:i386 Depends: libxrandr2:i386 but it is not installed E: Unmet dependencies. Try using -f. running " apt-get -f install " gives me the same error everytime.

    Read the article

  • Installation Error, "Unable to lock the administration directory"

    - by kern
    Whenever I try to install any software through Terminal or Software on my Ubuntu 11.04, I'm getting this response: In Terminal: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? In Software Center An unhandlable error occured There seems to be a programming error in aptdaemon, the software that allows you to install/remove software and to perform other package management related tasks. What should I do?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >