problem about error-messages-Collection of common programming errors
amon
parsing error-messages
I am writing a parser (a parser generator for PEGs) and am trying to figure out how to report errors.Grammar:rule: (a b)? a c ;Input:a dQuestion: Which error message correct at position 2 for given input?expected “b”, “c”. expected “c”.So should it be taken into account that “b” was also expected at position?The 1st error (expected “b”, “c”) wants to say that the input a b was expected but because it optional it is only a possibility, not a requirement.I don’t know possible is the same as expect
Bryan Kemp
web-services web error-handling error-messages
I realize that this may spur a religious discussion, but I discussed this with friends and get great, but conflicting answers and the actual documentation is of little help.What does the 500 series response codes mean from the webserver? Internal Server Error, but that is vague. My assumption is that it means that something bad happened to the server (file system corruption, no connection to the database, network issue, etc.) but not specifically a data driven error (divide by zero, record missi
Artes
equation-solving options error-messages modular-arithmetic diophantine-equations
I was trying to find all the numbers $n$ for which $2^n=n\mod 10^k$ using Mathematica. My first try:Reduce[2^n == n, n, Modulus -> 100]However, I receive the following error:Reduce::nsmet: This system cannot be solved with the methods available to Reduce. >>using $n^2$ instead of $2^n$ works just fine, where is the problem with $2^n\;$?On top of that, how do I keep the modulus $10^k$ variable and therefore, receive a solution dependent on $k\;$?
István Zachar
plotting bugs interpolation error-messages
One of the most annoying “features” of Mathematica is that the Plot family does extrapolation on InterpolatingFunctions without any warning. I’m sure it was discussed to hell previously, but I cannot seem to find any reference here in Mathematica.SE. While I know how to simply overcome the problem by defining a global variable for the domain of the interpolation, from time to time I forget to do this and then I spend days figuring out where does the numerical error originate. This can be avoided
mmal
error-messages messages
How can I want to switch off all messages in a Mathematica session? Quiet[expr] allows me to evaluate expr without messages. Off[msg] switches off the particular message msg.Is there a command that, once evaluated, guarantees that all further evaluations will run quietly? (Unless some messages are turned back On)
rcollyer
front-end error-messages
In a package I am developing, I accidentally left this lineProtect[uncompleted prior to running the package. Mathematica produced this error messageSyntax::sntup: Unexpected end of file (probably unclosed parenthesis)(line 102 of “DataListPlot`”).which includes the line number of the error. Since the code was short and it was the only thing in that cell, it was straightforward to find. But, in general, how would one find a specific line in a package? Also, is it possible in the standard package
m_goldberg
error-messages expression-manipulation
Here is a minimal example:s = 1 /(a + b[3]) + 1 /(2 a + b[3]); s[[1]] = Sum[s[[1]] /. b[3] -> k, {k, 3}] s[[4]] s[[4]] = Sum[s[[4]] /. b[3] -> k, {k, 3}]Output:Out[143]= 1/(1 + a) + 1/(2 + a) + 1/(3 + a) Out[144]= 1/(2 a + b[3])Set::partw: Part 4 of (1/(1+a)+1/(2+a)+1/(3+a))+1/(2 a+b[3]) does not exist. >>Out[145]= 1/(1 + 2 a) + 1/(2 + 2 a) + 1/(3 + 2 a)I could only make the error occur when using Set. As the above code shows, both s[[4]] and Sum[s[[4]] /. b[3] -> k, {k, 3}] are well de
Shog9
junior-programmer psychology error-messages
I think we’ve all seen this. Beginners ask questions on StackOverflow that follow the basic outline…I’m trying to do (very vague description of the goal) but it doesn’t work/I get an error/exception. Please help!Isn’t it bizarre that so many of them seem to consider it unnecessary to paste the error message?I wonder what the psychology of this is. What is it about error messages that makes people initially assume that they are useless and not worth paying any attention to?The answer I’m lookin
Jon Hopkins
error-messages internationalisation
So we’re looking at the possibility of porting our software to support multiple languages and one of the areas we’re going to have to deal with is error messages and other notifications.These obviously have to be reported to the users in their own language. Our team (largely) only speak English and even if we were all multi-lingual we’re looking at selling to a wide range of countries and could never expect to have a reasonable number of people speaking all languages (we’re a small company).The
DaveNay
c# error-messages end-users
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 p
rwong
error-messages privacy morale bug-report
I have some questions regarding whether to crash or report errors to the user. We are developing a web site and mobile clients in which we allow our users to report any bugs and crashes through e-mail. We require the user to send the e-mail from their e-mail account, so they can be identified. Here are some questions regarding it:We used to send the last stacktrace of java when user presses “send error report” button. As it has only technical details that user may not understand or care about, i
ArgentoSapiens
import error-messages
I’m trying to import a simple Excel file containing 94,000 rows and 52 columns of various types, mostly Reals. It’s a 38-MB file. I get this super helpful error message:Import::fmterr: Cannot import data as XLS format. >>A little googling reveals that for large files, Wolfram recommends this magic snippet:<< JLink`; InstallJava[]; ReinstallJava[JVMArguments -> “-Xmx512m”]But I get the same error no matter how big I make the number in “-Xmx512m”, which I assume is the Java heap siz
Sosi
parallel error-messages error-tracking
Following this question and the comments made, together with the information in this question, the following code allows error tracking and debugging very nicely.SetAttributes[withTaggedMsg, HoldAll];withTaggedMsg[sym_] := Function[,Internal`InheritedBlock[{MessagePacket},Unprotect[MessagePacket];MessagePacket[name__, BoxData[obj_, form_]] /; ! TrueQ[$tagMsg] :=Block[{$tagMsg = True},Identity@MessagePacket[name, BoxData[RowBox[{ToBoxes @ Style[Row[{“At iteration”, HoldForm[sym], “=”, sym, Spacer
halirutan
error-messages initialization
The report of this issue, which itself relates to code of my answer here, exposed a behavior I cannot explain. If I use StringMatchQ in combination with Alternative inside the init.m a message is thrown on start of the kernel.You can test this by putting this line in your init.mStringMatchQ[“name”, “noMatch” | “name”];and when you start the kernel you see two messages sayingThrow::nocatch: Uncaught Throw[False] returned to top level.Surrounding the statement by Catch does not help. The solution
Jonathan Rich
api-design error-handling errors error-messages
I’ve written an API which can be configured to signal errors in different ways (return values, debugging messages, or exceptions). I’ve got a check in place when the API is first initialized to see what type of error handling the client is requesting – what should I do when they request an undefined error handling type?This is kind of similar to “Where do I log the error that I can’t write to the logfile?”Do I go with the idiom of the language, do I fatal? Do I throw an exception, even though if
Stephen
php error-messages
Over on stackoverflow, I see this issue crop up all the time: E_NOTICE ?== E_DEBUG, avoiding isset() and @ with more sophisticated error_handler How to set PHP not to check undefind index for $_GET when E_NOTICE is on? How to stop PHP from logging PHP Notice errors How do I turn off such PHP 5.3 Notices ? Even Pekka (who offers a lot of solid PHP advice) has bumped against the dreaded E_NOTICE monster and hoped for a better solution than using isset(): isset() and empty() make code ugly
Kalle H. Väravas
php optimization error-messages
I recently turned all possible error-messages on with error_reporting(-1);, on my PHP project. Of course, right away I got alot of messages. For example:Notice: Undefined variable: foo in /…/file.php on line 205So I started updating my code to get rid of all the notices. Mostly, by adding isset($foo) and making the $foo = NULL;So, I’m wondering. How important are these notices really? I mean, if the $foo variable is not set, then it should be false/null/not-set by default..so technically the c
Mohsen
error-messages error-tracking debugging
One of the things that I really dislike about Mathematica is its lack of debuggability compared to many other programming languages. Some of the problems arises from the functional nature of Mathematica. However, some of them arises from the current state of Mathematica’s development environment and might be improved in later versions. Here is an incomplete list of reasons why Mathematica is less-debuggable compared to other languages. I guess some of you may disagree with some of the reasons be
Verbeia
error-messages error-tracking error-trapping
I was testing the source code of the answers to this question.And when I tried this response and maxed out most of the manipulators, this is what I got. What went wrong that the errors are tilted. Can anyone explain?Here’s the link for the Notebook.P.S. These are not Photoshopped.
Szabolcs
error-messages kernel-startup
I am getting errors like:Part::partd: Part specification standardBasis[[1]] is longer than depth of object.with the following Manipulate expression:Clear[ e1, e2, standardBasis, y] e1 := {1, 0} e2 := {0, 1} standardBasis := {e1, e2} y := 3 Manipulate[p := {x, y} ;Clear[j];arrowsReference = Table[Arrow[{p, p + Part[standardBasis, j]}], {j, 2}], {{x, 1}, -10, 10} ]The odd thing about it is that this only occurs immediately after starting Mathematica, on the source file that contains this manipula
kguler
manipulate error-messages
When I open the file containing the following code I get a series of error messages. Once I evaluate the cell with the code the error messages disappear. What is Mathematica doing when it opens a file, or how can avoid creating this problem for myself in the future?econmagic1[ ds_, di_, ss_, si_ ] := ((* begin equilibrium calculation *)A = { { 1, – 1 ds }, { 1, – ss } };CC = Inverse[ A ].{ di, si };Manipulate[(* begin grid layout*)Grid[{(* begin first row *){Show[(* begin initial supply curve
ironrunner
themes error-messages
I am using adaptive theme as a base for my sub theme and I accidentally deleted the base theme. I knew it wasn’t supposed to be a big problem if I just re-downloaded and dropped the theme back in the file directory but upon doing so I continued to get a 500 error.update : the specific error in the sites log, not the server log is:Call to undefined function load_subtheme_media_queries()
Artur
menu i18n error-messages
Has anyone run into trouble following i18n update to version 1.4? My site crashes badly with multiple notices about use of undefined constant MENU_PREFERRED_LINK. This is caused by Menu translation submodule.Submitted a bug report but thought maybe someone found out a cure for that.
lurkerbelow
c# api wcf error-messages
We are in the process of constructing an API (using WCF).So far I noticed 2 ways in which methods could go wrong due to problems with the parameters sent.wrong format, for example we have a string date parameter which should be in a certain format, if it’s in a different format the method cannot continue. if a method role is to do something identified by an ID, but that ID does not exist in the application (DB)First we thought throwing an exception, but I realize now that this is not truly an “e
AedonEtLIRA
error-messages
How, when developing a medium sized project, do you identify, create and maintain error codes?I for the life of me can’t think of a simple and clean method of doing so. Some of my ideas convert class names and method name into an integer string, but that is way to long to display to the user on top of the fact that method names and class names may change (hopefully not!). Others are just using an incrementing log system (ie. when ever I create a new error message, just add 1 to the last error me
bytebuster
terminology errors error-messages wording
Consider someone is writing a message (or a question at StackOverflow). The context is following:In my code, I have the following line:int foo = Bar();However, the compiler returns an error:line 42: Bar() is unknown functionI’m puzzled to choose a proper verb instead of “returns”. I’ve seen people using various verbs for it, but I stuck every time I read it:”returns” can be confused with a function return value; “throws” is for exceptions; “prints” has a little sense as the compiler output is no
Christina
evaluation error-messages dialog-window
The following creates a button to select a notebook to run. When the button is pressed it seems that Mathematica finds the notebook but cannot evaluate it. The following error occursCould not process unknown packet “1”Button[“run file 1”, NotebookEvaluate[“/../file1.nb”]]This occurs under Mathematica 8 on all platforms.Any help greatly appreciated, Christina
Sam
differential-equations numerics error-messages
I’m trying to solve the following BVP with unknown parameters (p and phi) using NDSolve over the period {Pi, 2 Pi}:a = 0.86;b = 0.4363; c = 0.129; d = 3;q = 2; V = 5;Ind = iL'[wt] (-a b V p[wt] Sech[b V iL[wt] p[wt]] Tanh[b V iL[wt] p[wt]] iL'[wt]-c d V p[wt] Sech[d V iL[wt] p[wt]] Tanh[d V iL[wt] p[wt]] iL'[wt])+(a Sech[b V iL[wt] p[wt]]+c Sech[d V iL[wt] p[wt]]) iL”[wt]sol = NDSolve[{Ind/q + iL[wt] == -Sin[wt + phi[wt]], p'[wt] == 0, phi'[wt] == 0, iL[Pi] == InverseFunction[(a ArcTan[Tanh[1/
Laxman13
mysql error-messages
I am using shared host and after some problems they restarted the server and my Drupal website shows the following error:PDOException: SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown table engine ‘InnoDB’: SELECT This is the full logError messagePDOException: SQLSTATE[42000]: Syntax error or access violation: 1286Unknown table engine ‘InnoDB’: SELECTfield_data_media_gallery_expose_block0.entity_type AS entity_type,field_data_media_gallery_expose_block0.entity_id AS entity_id,fiel
Web site is in building
I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money