Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Custom Error in Preview/Generate
ashman
Hello all,
Is it possible to throw a custom error message in the Preview/Generate process while processing a TPL?
In other words, I want to throw a custom error message to the user (e.g. Image Blah does not exist) from within a TPL and not generate the page when user tries to gen or regen an HTML page.
Thanks in advance...
Find more posts tagged with
Comments
Migrateduser
You can write whatever error message you want to the output file for the user, but also write some unique string (maybe in an HTML comment) that you can check for in workflow that prevents the content from being deployed.
ashman
If possible I don't want to involve any worklfow process into this as this might be a little to late in the authoring process for us.
Also, I don't want to put any error message in the generated HTML page - as I want to preserve the previous page (if it existed).
Ideally, I want to be able to display my custom error in the same Preview/Generate Error Popup that TeamSite throws in case it has an error in the page re/generation process.
Gregg Faus
To take John's approach a bit further. You could just detect whether this page is being previewed. See my post here for details:
http://devnet.interwoven.com/forums/cgi-bin/showthreaded.pl?Cat=&Board=PRODUCTS_TEMPLATING&Number=9779
.
Then only in the preview case, do your error checking and write out the HTML. When the page is actually generated, none of the error messages would be included.
Although this approach will print error messages, it doesn't prevent those errors from being present on the generated page.