Re: [Myghty-users] Myghty 0.99 Released
Brought to you by:
zzzeek
From: Shuo Y. <big...@gm...> - 2005-10-25 17:51:56
|
On 10/25/05, Ben Bangert <be...@gr...> wrote: > > On Oct 25, 2005, at 10:00 AM, Shuo Yang wrote: > > > > A stupid question about routes: > > > > Is there a way I can set routes to display the regular myghty error > > traceback instead of giving an empty page? > > > > Right now if I have an error in an component, it would just display > > an empty page. My routes setting is just this: > > > > m.connect(':controller/:action/:id') > > > > That's actually a different issue (definitely not a stupid > question :). The traceback displays if you call the component and > there's an error in it. However, if you use a URL that Routes can't > translate to a component call, you'll get the blank page you > experienced. > > That should actually be a 404 page, but Myghty leaves it empty so > that a web server can put in a 404. In the case of a stand-alone > server like we're using here with Paste, the "web server" doesn't > fill in any content. > > You can tell Paste to do this by changing the WSGI app maker in your > projects wsgiapp.py file: > > The last line is currently: > return Cascade([staticapp, myapp]) > > Change to: > return Cascade([staticapp, myapp, staticapp]) > > This will call the other static file parser after Myghty goes, so > you'll see a 404 page. Or if you want just switch the order of the > two arguments, they're merely determining the order that the Paste > server searches for resources. Static files in your public/ dir vs. > Myghty calls. Hopefully that makes sense? > > Now, onto the actual problem you're seeing. I stupidly didn't add a > fairly basic ability to Routes in 0.2 (it is fixed in the latest, and > soon-to-be 1.0) about having a trailing / on the URL. This means if > you want to call the Content controller's Index method, these URL's > will do it: > /content > /content/index > > But these will give you that blank page: > /content/ > content/index/ > > If you use the URL that "works" and have an error in that controller, > you should see the Myghty traceback as-is. My situation is exactly having the same URL, it worked with a "healthy" component, and it returns empty page once I add something like: <% garbage %> in my component. Note the same URL for both cases. So it's not displaying the traceback given a "good" url, but a "bad" component... Hope that helps, > Ben > > It's not the case in your setup? -- ---------------------------------------------------------------------------= ------------------------ John S. Yang |