Re: [turbogears-commits] r5496 - branches/1.1/turbogears

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [turbogears-commits] r5496 - branches/1.1/turbogears

by Christopher Arndt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi all,

I just commited this fix to the 1.1. branch because TurboGears will hang
(and could only be killed with a KILL signal), when an exception occurs
in 'startup.startTurboGears'. This could happen when you tried to open
the toolbox in a project with identity, but no ORM is installed.

But I'm not totally happy with the fix, because it essentially silently
ignores errors when loading TurboGears extensions (though it logs them).

If you look at my other commits before this one, you can see that I
tried prevent users from starting a project which needs a ORM when none
is installed, but still...

Anybody has any better ideas or comments?


Chris

svn-commits@... schrieb:

> Author: carndt
> Date: Sat Sep 27 23:17:57 2008
> New Revision: 5496
> URL: http://trac.turbogears.org/changeset/5496
>
> Log:
> Ignore errors when loading TurboGears extensions on startup or when starting them (CherryPy hangs when an exception occurs during startup)
>
> Modified:
>    branches/1.1/turbogears/startup.py
>
> Modified: branches/1.1/turbogears/startup.py
> ==============================================================================
> --- branches/1.1/turbogears/startup.py (original)
> +++ branches/1.1/turbogears/startup.py Sat Sep 27 23:17:57 2008
> @@ -228,9 +228,18 @@
>      # Start all TurboGears extensions
>      extensions = pkg_resources.iter_entry_points("turbogears.extensions")
>      for entrypoint in extensions:
> -        ext = entrypoint.load()
> +        try:
> +            ext = entrypoint.load()
> +        except Exception, e:
> +            log.error("Error loading TurboGears extension plugin '%s': %s",
> +                entrypoint, e)
> +            continue
>          if hasattr(ext, "start_extension"):
> -            ext.start_extension()
> +            try:
> +                ext.start_extension()
> +            except Exception, e:
> +                log.error("Error starting TurboGears extension '%s': %s",
> +                    entrypoint, e)
>  
>      for item in call_on_startup:
>          item()
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price!