2
$\begingroup$

Yes I understand how to use Messages[symbol] but that doesn't help much. I have no idea which important ones I may have missed in my search or even how many exist. Are there a mere 100 or so or tens of thousands? I am also aware of doing Messages[General] which gives about 4 or 5 dozen. In most cases this should suffice however I would rather not repeat code native to the system by creating new Message-s.

Since I have your attention how does one determine which messages go with Message (for errors) and which go with Failed and Failure?

Error or Failed? I tend to use the following rules of thumb:

  • Errors: tend to be bad argument inputs for example when a string is expected but string is defined with single quotes instead of double or expecting a list of text files but inadvertently sending a list of Excel files.
  • Failed: Unable to retrieve anything from anywhere (files, data, other objects) or unable to perform a remote process anywhere in the world you may be connected to including your own darn computer drive.

Does this sound correct to you? How would you change it?

To sum it up I would like to see a list of most common Message-s for both errors and Failure (or Failed) for use as a reference.

Thank you I hope I'm not asking for too much. :)

$\endgroup$
3
  • $\begingroup$ What do you need them for? $\endgroup$
    – MarcoB
    Nov 13, 2021 at 3:16
  • $\begingroup$ @MarcoB great question. right now I am only coding basic system personalization such as customizing $Path, automating the creation of packages, and lots and lots of custom interface construction, and automating many other general system tasks, but very little math and science although in a few months I will be flooded with it. so I guess I answered my own question. $\endgroup$ Nov 13, 2021 at 3:46
  • 2
    $\begingroup$ Related: mathematica.stackexchange.com/questions/14792/… -- There are over 8000 of them in FileNameJoin[{$InstallationDirectory, "SystemFiles", "Kernel", "TextResources", "English", "Messages.m"}]. I don't know if the list is comprehensive. $\endgroup$
    – Michael E2
    Nov 14, 2021 at 2:47

1 Answer 1

1
$\begingroup$

In the System context

systemNames = Names["System`*"];

Length@systemNames

(* 7091 *)

messages = Flatten[
    Messages /@ Cases[ToExpression /@ systemNames, _Symbol]] // 
   Quiet;

Length@messages

(* 4400 *)
$\endgroup$
2
  • 3
    $\begingroup$ Messages are often dynamically loaded when particular errors occur. Until they are loaded, they do not show up in Messages[symbol]. $\endgroup$
    – Michael E2
    Nov 14, 2021 at 2:45
  • $\begingroup$ @BobHanlon wow that's well over 11000 just for the main context. that's just crazy! $\endgroup$ Dec 12, 2021 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.