Closed danbuis closed 4 years ago
Nope, looks like we gotta keep it in some capacity due to resource loading. I'm going to try to keep it local instead of propogating the exception up.
Used some try/catch blocks to prevent exceptions from propagating up.
Got a nice reminder on exceptions that I'll leave here for posterity. Basically exceptions have to be caught at some point, if there is not an explicit try/catch block when it is thrown than the next method on the stack needs to know that it might have an exception incoming at some point. This is what had happened prior. No one was catching the exception so it propagated all the way to the bottom of the stack, the Engine class.
Now we are catching the exceptions locally, leading to cleaner method signatures in a lot of other places. Since there are so many exceptions possible in the shader class, I'm letting the user implementing class handle them in case they want to have some funky retry or default type logic. In the example game I'm just wrapping things in a simple try/catch with no bells or whistles.
Its never thrown. Its not clear why it is in there. Maybe we can remove it.