ID:118570
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
There should be a proc that developers can override such as world.onError(), which would allow the developer to catch the errors thrown while a world is running, and create code to compensate, or alert, based on the error received. For example, if Dream Daemon throws a list index out of bounds error, then the developer could override the proc to possibly expand the list, and retry the function. The proc could be set up like:


world
onError(var/Proc as text, var/File as text, var/atom/U=usr, var/atom/S=src, var/stack[])

where Proc is the proc that threw the error, File is the file the proc is located in, line is the line number in the file the error was thrown at, U is the usr returned by the proc, S is the src returned by the proc, and stack[] is the stack trace list as reported.

Essentially, the proc onError() would allow the developer to gather the data thrown by the error as it happens, as opposed to a workaround such as logging to a file and creating a background process to continuously check said log file for new data.

This new proc would allow better alert handling, and for hosts that use DreamDaemon on a seperate machine, would even allow them to have errors sent to them while they are logged in, without having to be at the hosting machine to scroll through the logs in the daemon.
Developers can already log runtime errors.
not to a var in-game. The entire purpose of this is to allow it to be sent to a var in-game to be used in the actual code.
If you're going to write a procedure to 'fix' lists and other variables or whatever if they encounter an error, there's no point to that if you can just program well enough & think ahead to avoid having errors like that.
You are completely missing the other things that can be done with it. Ultimately, i am going to write a script to text me if there are any errors on my games, seeing as i host them myself on my own machine. If you were to think outside the box, you would have seen that this is a useful thing to have. Writing a procedure to "fix" lists on the fly is improbable, anyway.
You mean, like in this example you gave of 'fixing' a list error, right?

"For example, if Dream Daemon throws a list index out of bounds error, then the developer could override the proc to possibly expand the list, and retry the function."
No. Like if it throws an out of bounds error, or ANY kind of error, the developer could write code to say, for example, check if they are logged in, and show them the error (for those of us who use DD to host remotely and want to know of errors) or for PHP devs like myself who could write a script to send an email, or a text, to myself to alert of me any errors that happen.
Something like this should allow you to easily pull errors off of a remotely hosted server:
world/New()
world.log=file("Log.txt")
return ..()

mob/GM/verb/Download_Log()
src<<ftp(file("Log.txt"))
You are all completely missing the entire point. This is to catch errors AS THEY HAPPEN. You all seem to be missing that key part, so i will say it again:

AS THEY HAPPEN.

The benefit of this would be the developer could easily use the information to create in-game alerts for faster debugging if the game is hosted remotely. It would also open the door for php scripts for email alerts.

The reason you wouldnt want to use the log file is because that file has EVERY error logged to it. On top of that, it would become hard on the CPU to constantly check for new data on that log. having a built-in proc such as OnError() would make things SO much easier.

If you were to compare it to a mainstream language such as Java, or C#, the equivalent would be a try()/catch() block of code. You all are MISSING THE POINT that im trying to explain. Maybe if you were to READ THESE COMMENTS IM POSTING you would see what im talking about.

If you dont see the benefit of this addition, please refrain from posting as you obviously do not know the first thing about error catching.

If you see the benefit of it, feel free to post your support, or other related suggestions.

If your suggestion involves world.log, or ANY VARIATION, please lay your hands on the table, and have a friend smash them with a hammer as i JUST WENT OVER THIS.

TL;DR: READ IT ANYWAY
Ok. Let me make this quite clear right now:

This would help developers who use a remote server to host. I could then easily write a script to alert me of SPECIFIC errors, along with details, in simple code. Also, if you have several worlds accessing their log files all the time, it can create quite a bit of pull on a CPU.

On another note: Different people have different computers. This may come as a shock to you, but not everyone has a CPU that can run a hardcore server setup.

And another thing: This was meant as a suggestion to the BYOND staff. The fact that you are critiquing it says that you have too much free time, and need to get a freaking life. Go find another place to comment. I dont need this page loaded down with a bunch of BS from trolls, jerks, idiots, and ignorant people.

And yes, Falacy.. You are in the list of people i dont need.
I think something like try and catch blocks would be awesome. Something like this would be great:

try
var/X[2]
world<<X[3]
catch( var/DMError/E )
world<<"Error occured at [E.Line]"
world<<"Error type: [E.ErrorType]"
ExPixel wrote:
I think something like try and catch blocks would be awesome. Something like this would be great:

> try
> var/X[2]
> world<<X[3]
> catch( var/DMError/E )
> world<<"Error occured at [E.Line]"
> world<<"Error type: [E.ErrorType]"
>

EXACTLY what im talking about. It would have so many uses beyond what i plan on using it for, too!
The_Zergling wrote:
And another thing: This was meant as a suggestion to the BYOND staff. The fact that you are critiquing it says that you have too much free time, and need to get a freaking life. Go find another place to comment. I dont need this page loaded down with a bunch of BS from trolls, jerks, idiots, and ignorant people.

All feature suggestions that are made, are completely open to criticism from the users, we're a community here. Feedback is what we give. If Lummy & Tom can't see the opinions of other users, do you know how much useless & unused features would be added?
Falacy wrote:
Stuff...

That requires a large amount of usage with files. Also a try and catch type of thing would probably have less CPU usage from using so much text and file manipulation.

I have maxed out the log file, by creating an error loop that would repeat until error reporting forcibly stopped. This only created a file of about 13kB, and was still only using 0% CPU. I also spammed the logfile's contents, way beyond normal game parameters, to nearly 500kB, this was only using 2% CPU at most. This was running 10 times a second, you could obviously slow it down and still receive timely notification of errors.

Considering the goal is to never get runtime errors, world.log should be more than enough. If you're just sitting around waiting for the next text that your game is broken, then you're doing it wrong. Really, you just need to download the logfile once a day or so, check it for any errors, most of which should just be repeats, and resolve the issue(s) for your game's next patch.
Falacy, open your freakin eyes. If i wanted to download the log file, i would. Thats not a problem. The thing is that this kind of thing is used so much it MIGHT AS WELL have a built-in feature for it.

It doesnt matter if YOU think its redundant, stupid, or whatever your opinion is. You are being ignorant to the entire fact that it would be useful to MANY PEOPLE OTHER THAN ME, AND PEOPLE WHO ARENT TROLLS LIKE YOU.

You are right - the goal is to never get runtime errors. But the goal is also to have a game that doesnt hog CPU, doesnt have unnecessary loops, doesnt require tweaking to get it to when you want it... The goal is to have ACTIVE error reporting as it happens immediately.

Downloading the text in the log file is one alternative for now, yes. Is it the best? In my opinion, no.

Get your head out of your crack and stop shooting down an idea just cause YOU dont like me. On top of that, i dont get why anyone even likes YOU after what BS you pulled in the past.
Falacy, I've had to delete some inappropriate comments from you on this comment thread. Keep it civil please.

And stop the bold text reply thing. I'm through tolerating that, inasmuch as I ever did.
Wasn't kidding about the bold thing. I have some concepts for improving on the quotes that dovetail with what I'm alraedy working on right now, so that is being addressed. In the meantime, enough is enough.