09. Error handling
Error Handling
There's a code inside game loop "try catch" to prevent it from crash and then quite.
To avoid crashing you can subscribe to an event handler withing a callback.
using System;
using System.Drawing;
using System.Windows.Forms;
using MELHARFI.Manager;
using MELHARFI.Manager.Gfx;
namespace _2dProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Manager manager = new Manager(this, "CORE_ENGINE");
manager.Background = Color.Blue;
manager.OutputErrorCallBack = CatchError;
}
private void CatchError(string error)
{
// show notification for your error here or ignore it.
}
}
}
Want me to dev an app for you ? dont hesitate to contact me.
Are you looking for a coder/teammate for your project ? Let's give it a try.
Have a proposal for me ? we can discuss about it.
You want to buy me a coffe ? m.elharfi@gmail.com