Skip to content
Sign upLog in
← Back to Community

Repl.it error messages?

Profile icon
DynamicSquidHacker

Is there a way that I can get a list of error messages for repl.it? Specifically the Python and C++ errors. For example a C++ error would be this:

Screenshot (86)

I'm asking this since I'm making a project that tries to replicate an error message.

So is there a like a way I could get the different types of errors? Or do I have to just do it manually by putting errors in my code and seeing the result?

Answered by CodeLongAndPros [earned 5 cycles]
View Answer
Voters
Profile icon
ElectroN404
Profile icon
firefish
Profile icon
DynamicSquid
Comments
hotnewtop
Profile icon
CodeLongAndPros

You can look at GCC/Clang source code, for those.

Python has an exception class and a defined format for stack traces.

For SegFaults, just send a SEGV signal.

Now that this is the answer, let me be clear:

Looking through the GCC code for error messages is not easy!

Thank you.

Profile icon
DynamicSquid

@CodeLongAndPros
where can I find it?

Profile icon
CodeLongAndPros
Profile icon
DynamicSquid

@CodeLongAndPros
oh yeah, don't worry. but the Python thing helped me out a lot

Profile icon
CodeLongAndPros
Profile icon
xxpertHacker

Repl doesn't have it's own error messages, Repl just runs the GCC / CLang compiler, the compiler is what issues errors and warnings. You'll need to look at their documentation for everything they have. (Just a tip, Clang gives better error messages).

Also, very important to note, neither of their error messages are too good, now Rust's error messages, those are great, go look at some Rust errors.

Profile icon
DynamicSquid

@StudentFires
oh thanks! and for rust, I might take a look at those, but I'm not familiar with rust that much..

Profile icon
xxpertHacker

@DynamicSquid
You don't need to be very familiar, it's kinda close to C++ in many regards, the error messages aren't cryptic though, like C++'s can be.

Profile icon
Coder100

What do you mean getting the different types of errors?
As in a try catch statement?

Profile icon
DynamicSquid

@Coder100
Oh, so I'm making something that prints out a bunch of strings, and those strings look like an error message. Or in other words, I'm trying to replicate them

Profile icon
Coder100

yeah, you are going to have to find them yourself ;)
errors are a platform-specific thing

@DynamicSquid