polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Don't throw Exceptions during Bootstrap
Date Fri, 24 Mar 2017 09:30:53 GMT
Gang,
I was just thinking;

We want it to become more efficient to find the runtime problems. One of
the major problems is that one gets an exception after exception the first
time we try to get going with a new project or a new subsystem in an
existing project. And this start->exception->edit->compile cycle is tedious
and not fun.

Suggestion;
1. Introduce a "bootstrapPhase" somewhere.
2. Enhance ConstructionException with exact details of everything going on.
3. Make the ConstructionException constructor private and introduce a
public static method to be called.
4. If Application.mode() is development or test, and bootstrapPhase is
true, then add the Exception to a ThreadLocal list, otherwise throw
exception as previously.
5. Figure out when bootstrap phase is "over", check if there are any
Excepitons in the list, if so, generate an elaborate, machine readable
report (for tooling) and abort. Otherwise clear bootstrapPhase and continue
as normal.

I am not sure if all structural problems can be caught in one swoop or not,
but I am sure it would be a big improvement. Also, there might be other
Exceptions that should be involved in this as well.

WDYT?

Cheers
-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org <http://zest.apache.org> - New Energy for Java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message