-rw-r--r-- | htdocs/exceptions/compile.chtml | 3 | ||||
-rw-r--r-- | htdocs/exceptions/index.chtml | 3 | ||||
-rw-r--r-- | htdocs/exceptions/preprocess.chtml | 3 | ||||
-rw-r--r-- | htdocs/exceptions/runtime.chtml | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/htdocs/exceptions/compile.chtml b/htdocs/exceptions/compile.chtml index 68dd034..94bd2e1 100644 --- a/htdocs/exceptions/compile.chtml +++ b/htdocs/exceptions/compile.chtml | |||
@@ -1,52 +1,53 @@ | |||
1 | % html(); return; /* vim:set ft=sitecing: */ | 1 | % /* vim:set ft=sitecing: */ |
2 | %%derive layout = "/ancestry/layout.chtml"; | 2 | %%derive layout = "/ancestry/layout.chtml"; |
3 | %%pragma main=page | ||
3 | <%constructor> | 4 | <%constructor> |
4 | b_strict = false; | 5 | b_strict = false; |
5 | PN_PREV("/exceptions/preprocess","preprocess","preprocessing errors"); | 6 | PN_PREV("/exceptions/preprocess","preprocess","preprocessing errors"); |
6 | PN_NEXT("/exceptions/runtime","runtime","runtime exceptions"); | 7 | PN_NEXT("/exceptions/runtime","runtime","runtime exceptions"); |
7 | </%constructor> | 8 | </%constructor> |
8 | <%codemethod string title() %> | 9 | <%codemethod string title() %> |
9 | return "compile-time exceptions handling"; | 10 | return "compile-time exceptions handling"; |
10 | </%codemethod> | 11 | </%codemethod> |
11 | <%method void content() %> | 12 | <%method void content() %> |
12 | <h1>site-C-ing compile-time exception handling</h1> | 13 | <h1>site-C-ing compile-time exception handling</h1> |
13 | <p> | 14 | <p> |
14 | Similar to <a href="/exceptions/preprocess">preprocessing exceptions</a> | 15 | Similar to <a href="/exceptions/preprocess">preprocessing exceptions</a> |
15 | there is a wide range of errors you may put into your code which will pass | 16 | there is a wide range of errors you may put into your code which will pass |
16 | through preprocessor and will be caught later at the compile-time. | 17 | through preprocessor and will be caught later at the compile-time. |
17 | </p> | 18 | </p> |
18 | <p> | 19 | <p> |
19 | Once you complete writing your <a | 20 | Once you complete writing your <a |
20 | href="/view/htdocs/exceptions/development/compile.chtml" target="insert" | 21 | href="/view/htdocs/exceptions/development/compile.chtml" target="insert" |
21 | title="the link opens in the frame below">erroneous code</a> and | 22 | title="the link opens in the frame below">erroneous code</a> and |
22 | <em>site-C-ing</em> is done preprocessing it, it will feed the preprocessed | 23 | <em>site-C-ing</em> is done preprocessing it, it will feed the preprocessed |
23 | code into c++ compiler which will refuse to compile the code like this. This | 24 | code into c++ compiler which will refuse to compile the code like this. This |
24 | is where <a href="/view/htdocs/handlers/exception_dev" target="insert" | 25 | is where <a href="/view/htdocs/handlers/exception_dev" target="insert" |
25 | title="the link opens in the frame below">the exception handler</a>, | 26 | title="the link opens in the frame below">the exception handler</a>, |
26 | specified in <a href="/view/htdocs/exceptions/development/.scrc" | 27 | specified in <a href="/view/htdocs/exceptions/development/.scrc" |
27 | target="insert" title="the link opens in the frame below">the configuration | 28 | target="insert" title="the link opens in the frame below">the configuration |
28 | file</a>, takes over the process and gives you <a | 29 | file</a>, takes over the process and gives you <a |
29 | href="/exceptions/development/compile" target="insert" title="the link opens | 30 | href="/exceptions/development/compile" target="insert" title="the link opens |
30 | in the frame below">the report</a>. Like with any handler, you may wish to | 31 | in the frame below">the report</a>. Like with any handler, you may wish to |
31 | set some <a href="/view/htdocs/handlers/exception_prod" target="insert" | 32 | set some <a href="/view/htdocs/handlers/exception_prod" target="insert" |
32 | title="the link opens in the frame below">different handler</a> in your <a | 33 | title="the link opens in the frame below">different handler</a> in your <a |
33 | href="/view/htdocs/exceptions/production/.scrc" target="insert" title="the | 34 | href="/view/htdocs/exceptions/production/.scrc" target="insert" title="the |
34 | link opens in the frame below">production configuration</a>, which just gives | 35 | link opens in the frame below">production configuration</a>, which just gives |
35 | user <a href="/exceptions/production/preprocess" target="insert" title="the | 36 | user <a href="/exceptions/production/preprocess" target="insert" title="the |
36 | link opens in the frame below">a friendly yet lame excuse</a>. | 37 | link opens in the frame below">a friendly yet lame excuse</a>. |
37 | </p> | 38 | </p> |
38 | <p class="note"> | 39 | <p class="note"> |
39 | Note, that these output pages are fakes -- I do not want to spawn the | 40 | Note, that these output pages are fakes -- I do not want to spawn the |
40 | compiler each time you want to see the output and put this unnecessary load | 41 | compiler each time you want to see the output and put this unnecessary load |
41 | on cpu. These static pages are in fact saved output of the real exception | 42 | on cpu. These static pages are in fact saved output of the real exception |
42 | handlers. | 43 | handlers. |
43 | </p> | 44 | </p> |
44 | 45 | ||
45 | <div class="insert"> | 46 | <div class="insert"> |
46 | <iframe id="insert" name="insert" src="about:blank" width="95%" height="300"> | 47 | <iframe id="insert" name="insert" src="about:blank" width="95%" height="300"> |
47 | <p>I wanted to put an <iframe> here, but your browser does not seem to | 48 | <p>I wanted to put an <iframe> here, but your browser does not seem to |
48 | support it. That is okay, it still will open links somehow.</p> | 49 | support it. That is okay, it still will open links somehow.</p> |
49 | </iframe> | 50 | </iframe> |
50 | </div> | 51 | </div> |
51 | 52 | ||
52 | </%method> | 53 | </%method> |
diff --git a/htdocs/exceptions/index.chtml b/htdocs/exceptions/index.chtml index 6bb2a3c..c700e42 100644 --- a/htdocs/exceptions/index.chtml +++ b/htdocs/exceptions/index.chtml | |||
@@ -1,56 +1,57 @@ | |||
1 | % html(); return; /* vim:set ft=sitecing: */ | 1 | % /* vim:set ft=sitecing: */ |
2 | %%derive layout = "/ancestry/layout.chtml"; | 2 | %%derive layout = "/ancestry/layout.chtml"; |
3 | %%pragma main=page | ||
3 | <%constructor> | 4 | <%constructor> |
4 | PN_PREV("/simple","simple page","building a really simple page"); | 5 | PN_PREV("/simple","simple page","building a really simple page"); |
5 | PN_NEXT("/exceptions/preprocess","preprocess","preprocessing errors"); | 6 | PN_NEXT("/exceptions/preprocess","preprocess","preprocessing errors"); |
6 | </%constructor> | 7 | </%constructor> |
7 | <%codemethod string title() %> | 8 | <%codemethod string title() %> |
8 | return "exceptions handling"; | 9 | return "exceptions handling"; |
9 | </%codemethod> | 10 | </%codemethod> |
10 | <%method void content() %> | 11 | <%method void content() %> |
11 | <h1>site-C-ing exception handling</h1> | 12 | <h1>site-C-ing exception handling</h1> |
12 | <p> | 13 | <p> |
13 | The purpose of this section is to give an overview of the <em>site-C-ing</em> | 14 | The purpose of this section is to give an overview of the <em>site-C-ing</em> |
14 | exception handling mechanism. Before the web visitor can see the page each | 15 | exception handling mechanism. Before the web visitor can see the page each |
15 | site-C-ing component goes through a few stages, namely, preprocessing, | 16 | site-C-ing component goes through a few stages, namely, preprocessing, |
16 | compiling and execution. Having three stages to go through also means three | 17 | compiling and execution. Having three stages to go through also means three |
17 | stages one can fail to go through and three exciting opportunities to handle | 18 | stages one can fail to go through and three exciting opportunities to handle |
18 | different errors. | 19 | different errors. |
19 | </p> | 20 | </p> |
20 | <p> | 21 | <p> |
21 | First each component is preprocessed so that you can feed the valid c++ code | 22 | First each component is preprocessed so that you can feed the valid c++ code |
22 | to the compiler. Here is where the preprocessor can choke at your broken | 23 | to the compiler. Here is where the preprocessor can choke at your broken |
23 | source code. Once preprocessor failes to parse your code it will throw an | 24 | source code. Once preprocessor failes to parse your code it will throw an |
24 | exception which <em>site-C-ing</em> will catch and pass to <a | 25 | exception which <em>site-C-ing</em> will catch and pass to <a |
25 | href="/sources/htdocs/handlers/exception_dev" title="development mode | 26 | href="/sources/htdocs/handlers/exception_dev" title="development mode |
26 | exception handler source">the exception handler component</a>. Want to <a | 27 | exception handler source">the exception handler component</a>. Want to <a |
27 | href="/exceptions/preprocess">read more</a> about preprocessor exception | 28 | href="/exceptions/preprocess">read more</a> about preprocessor exception |
28 | handling? | 29 | handling? |
29 | </p> | 30 | </p> |
30 | <p> | 31 | <p> |
31 | After the preprocessing stage is over we have a great opportunity to catch | 32 | After the preprocessing stage is over we have a great opportunity to catch |
32 | the compile-time errors. After <em>site-C-ing</em> fails to compile the | 33 | the compile-time errors. After <em>site-C-ing</em> fails to compile the |
33 | component it throws another exception and passes it to the same handler which | 34 | component it throws another exception and passes it to the same handler which |
34 | may show you some information on what's gone wrong with your source code from | 35 | may show you some information on what's gone wrong with your source code from |
35 | the compiler's perspective. If you've gone this far you definitely want to <a | 36 | the compiler's perspective. If you've gone this far you definitely want to <a |
36 | href="/exceptions/compile">read more</a> about the compiler error handling. | 37 | href="/exceptions/compile">read more</a> about the compiler error handling. |
37 | </p> | 38 | </p> |
38 | <p class="note"> | 39 | <p class="note"> |
39 | Note, that it is likely that you will want to disable the steps above for the | 40 | Note, that it is likely that you will want to disable the steps above for the |
40 | production environment to save time on unnecessary checking whether the | 41 | production environment to save time on unnecessary checking whether the |
41 | component is up to date. | 42 | component is up to date. |
42 | </p> | 43 | </p> |
43 | <p> | 44 | <p> |
44 | Finally, we need to execute the component and present its output to the web | 45 | Finally, we need to execute the component and present its output to the web |
45 | site visitor. This is also where things may go wrong and here is where your | 46 | site visitor. This is also where things may go wrong and here is where your |
46 | component may throw an exception for the engine to catch and pass to the | 47 | component may throw an exception for the engine to catch and pass to the |
47 | handler. Feel free to <a href="/exceptions/runtime">learn more</a> about it | 48 | handler. Feel free to <a href="/exceptions/runtime">learn more</a> about it |
48 | as well. | 49 | as well. |
49 | </p> | 50 | </p> |
50 | <p class="note"> | 51 | <p class="note"> |
51 | One more thing you will likely want to have differently in production | 52 | One more thing you will likely want to have differently in production |
52 | environment is <a href="/sources/htdocs/handlers/exception_prod" | 53 | environment is <a href="/sources/htdocs/handlers/exception_prod" |
53 | title="production mode exception handler source">an exception handler</a> | 54 | title="production mode exception handler source">an exception handler</a> |
54 | which will not give out that much unnecessary information to the user. | 55 | which will not give out that much unnecessary information to the user. |
55 | </p> | 56 | </p> |
56 | </%method> | 57 | </%method> |
diff --git a/htdocs/exceptions/preprocess.chtml b/htdocs/exceptions/preprocess.chtml index 88b8741..e42b102 100644 --- a/htdocs/exceptions/preprocess.chtml +++ b/htdocs/exceptions/preprocess.chtml | |||
@@ -1,48 +1,49 @@ | |||
1 | % html(); return; /* vim:set ft=sitecing: */ | 1 | % /* vim:set ft=sitecing: */ |
2 | %%derive layout = "/ancestry/layout.chtml"; | 2 | %%derive layout = "/ancestry/layout.chtml"; |
3 | %%pragma main=page | ||
3 | <%constructor> | 4 | <%constructor> |
4 | b_strict = false; | 5 | b_strict = false; |
5 | PN_PREV("/exceptions","exceptions","exception handling overview"); | 6 | PN_PREV("/exceptions","exceptions","exception handling overview"); |
6 | PN_NEXT("/exceptions/compile","compile-time","compile-time errors"); | 7 | PN_NEXT("/exceptions/compile","compile-time","compile-time errors"); |
7 | </%constructor> | 8 | </%constructor> |
8 | <%codemethod string title() %> | 9 | <%codemethod string title() %> |
9 | return "preprocessor exceptions handling"; | 10 | return "preprocessor exceptions handling"; |
10 | </%codemethod> | 11 | </%codemethod> |
11 | <%method void content() %> | 12 | <%method void content() %> |
12 | <h1>site-C-ing preprocessor exception handling</h1> | 13 | <h1>site-C-ing preprocessor exception handling</h1> |
13 | <p> | 14 | <p> |
14 | It was one of those days when you just can't type right and can't think of | 15 | It was one of those days when you just can't type right and can't think of |
15 | what you're typing. It is not unusual that, under such circumstances, you end | 16 | what you're typing. It is not unusual that, under such circumstances, you end |
16 | up with a code like <a | 17 | up with a code like <a |
17 | href="/view/htdocs/exceptions/development/preprocess.chtml" target="insert" | 18 | href="/view/htdocs/exceptions/development/preprocess.chtml" target="insert" |
18 | title="the link opens in the frame below">this</a> -- by the time you were | 19 | title="the link opens in the frame below">this</a> -- by the time you were |
19 | about to close your <code><%code></code> block you were thinking about | 20 | about to close your <code><%code></code> block you were thinking about |
20 | some constructor in some component elsewhere in the universe. | 21 | some constructor in some component elsewhere in the universe. |
21 | </p> | 22 | </p> |
22 | <p> | 23 | <p> |
23 | <em>site-C-ing</em> parser will see the inconsistency and throw an exception | 24 | <em>site-C-ing</em> parser will see the inconsistency and throw an exception |
24 | which will be caught and passed to <a | 25 | which will be caught and passed to <a |
25 | href="/view/htdocs/handlers/exception_dev" target="insert" title="the link | 26 | href="/view/htdocs/handlers/exception_dev" target="insert" title="the link |
26 | opens in the frame below">the handler</a>, specified in <a | 27 | opens in the frame below">the handler</a>, specified in <a |
27 | href="/view/htdocs/exceptions/development/.scrc" target="insert" title="the | 28 | href="/view/htdocs/exceptions/development/.scrc" target="insert" title="the |
28 | link opens in the frame below">the configuration file</a>, which will produce | 29 | link opens in the frame below">the configuration file</a>, which will produce |
29 | some nice, human-readable <a href="/exceptions/development/preprocess" | 30 | some nice, human-readable <a href="/exceptions/development/preprocess" |
30 | target="insert" title="the link opens in the frame below">output</a>. Well, | 31 | target="insert" title="the link opens in the frame below">output</a>. Well, |
31 | you may not wish to give out all this information in the production | 32 | you may not wish to give out all this information in the production |
32 | environment, so you just put in your <a | 33 | environment, so you just put in your <a |
33 | href="/view/htdocs/exceptions/production/.scrc" target="insert" title="the | 34 | href="/view/htdocs/exceptions/production/.scrc" target="insert" title="the |
34 | link opens in the frame below">configuration file</a> some <a | 35 | link opens in the frame below">configuration file</a> some <a |
35 | href="/view/htdocs/handlers/exception_prod" target="insert" title="the link | 36 | href="/view/htdocs/handlers/exception_prod" target="insert" title="the link |
36 | opens in the frame below">different handler</a>, which just gives user <a | 37 | opens in the frame below">different handler</a>, which just gives user <a |
37 | href="/exceptions/production/preprocess" target="insert" title="the link | 38 | href="/exceptions/production/preprocess" target="insert" title="the link |
38 | opens in the frame below">a friendly yet lame excuse</a>. | 39 | opens in the frame below">a friendly yet lame excuse</a>. |
39 | </p> | 40 | </p> |
40 | 41 | ||
41 | <div class="insert"> | 42 | <div class="insert"> |
42 | <iframe id="insert" name="insert" src="about:blank" width="95%" height="300"> | 43 | <iframe id="insert" name="insert" src="about:blank" width="95%" height="300"> |
43 | <p>I wanted to put an <iframe> here, but your browser does not seem to | 44 | <p>I wanted to put an <iframe> here, but your browser does not seem to |
44 | support it. That is okay, it still will open links somehow.</p> | 45 | support it. That is okay, it still will open links somehow.</p> |
45 | </iframe> | 46 | </iframe> |
46 | </div> | 47 | </div> |
47 | 48 | ||
48 | </%method> | 49 | </%method> |
diff --git a/htdocs/exceptions/runtime.chtml b/htdocs/exceptions/runtime.chtml index 1fcd80f..989e89f 100644 --- a/htdocs/exceptions/runtime.chtml +++ b/htdocs/exceptions/runtime.chtml | |||
@@ -1,49 +1,50 @@ | |||
1 | % html(); return; /* vim:set ft=sitecing: */ | 1 | % /* vim:set ft=sitecing: */ |
2 | %%derive layout = "/ancestry/layout.chtml"; | 2 | %%derive layout = "/ancestry/layout.chtml"; |
3 | %%pragma main=page | ||
3 | <%constructor> | 4 | <%constructor> |
4 | b_strict = false; | 5 | b_strict = false; |
5 | PN_PREV("/exceptions/compile","compile-time","compile-time errors"); | 6 | PN_PREV("/exceptions/compile","compile-time","compile-time errors"); |
6 | PN_NEXT("/quickref/","quick reference","quick reference"); | 7 | PN_NEXT("/quickref/","quick reference","quick reference"); |
7 | </%constructor> | 8 | </%constructor> |
8 | <%codemethod string title() %> | 9 | <%codemethod string title() %> |
9 | return "runtime exceptions handling"; | 10 | return "runtime exceptions handling"; |
10 | </%codemethod> | 11 | </%codemethod> |
11 | <%method void content() %> | 12 | <%method void content() %> |
12 | <h1>site-C-ing runtime exception handling</h1> | 13 | <h1>site-C-ing runtime exception handling</h1> |
13 | <p> | 14 | <p> |
14 | The component may throw an exception while executing and the | 15 | The component may throw an exception while executing and the |
15 | <em>site-C-ing</em> will gladly pass it to the handler component which will | 16 | <em>site-C-ing</em> will gladly pass it to the handler component which will |
16 | give the user appropriate output (unless it throws an exception itself, of | 17 | give the user appropriate output (unless it throws an exception itself, of |
17 | course). Here you will see an example output provided by the handler bundled | 18 | course). Here you will see an example output provided by the handler bundled |
18 | with the <em>site-C-ing</em>. | 19 | with the <em>site-C-ing</em>. |
19 | </p> | 20 | </p> |
20 | 21 | ||
21 | <p> | 22 | <p> |
22 | Suppose you have <a href="/view/htdocs/exceptions/development/runtime.chtml" | 23 | Suppose you have <a href="/view/htdocs/exceptions/development/runtime.chtml" |
23 | target="insert" title="the link opens in the frame below">a component</a>, | 24 | target="insert" title="the link opens in the frame below">a component</a>, |
24 | which at some point throws an exception. Of course, <em>site-C-ing</em> will | 25 | which at some point throws an exception. Of course, <em>site-C-ing</em> will |
25 | catch the exception and pass it to <a | 26 | catch the exception and pass it to <a |
26 | href="/view/htdocs/handlers/exception_dev" target="insert" title="the link | 27 | href="/view/htdocs/handlers/exception_dev" target="insert" title="the link |
27 | opens in the frame below">the handler</a>, specified in <a | 28 | opens in the frame below">the handler</a>, specified in <a |
28 | href="/view/htdocs/exceptions/development/.scrc" target="insert" title="the | 29 | href="/view/htdocs/exceptions/development/.scrc" target="insert" title="the |
29 | link opens in the frame below">the configuration file</a>, which will produce | 30 | link opens in the frame below">the configuration file</a>, which will produce |
30 | some nice, human-readable <a href="/exceptions/development/runtime" | 31 | some nice, human-readable <a href="/exceptions/development/runtime" |
31 | target="insert" title="the link opens in the frame below">output</a>. Well, | 32 | target="insert" title="the link opens in the frame below">output</a>. Well, |
32 | you may not wish to give out all this information in the production | 33 | you may not wish to give out all this information in the production |
33 | environment, so you just put in your <a | 34 | environment, so you just put in your <a |
34 | href="/view/htdocs/exceptions/production/.scrc" target="insert" title="the | 35 | href="/view/htdocs/exceptions/production/.scrc" target="insert" title="the |
35 | link opens in the frame below">configuration file</a> some <a | 36 | link opens in the frame below">configuration file</a> some <a |
36 | href="/view/htdocs/handlers/exception_prod" target="insert" title="the link | 37 | href="/view/htdocs/handlers/exception_prod" target="insert" title="the link |
37 | opens in the frame below">different handler</a>, which just gives user <a | 38 | opens in the frame below">different handler</a>, which just gives user <a |
38 | href="/exceptions/production/runtime" target="insert" title="the link opens | 39 | href="/exceptions/production/runtime" target="insert" title="the link opens |
39 | in the frame below">a friendly yet lame excuse</a>. | 40 | in the frame below">a friendly yet lame excuse</a>. |
40 | </p> | 41 | </p> |
41 | 42 | ||
42 | <div class="insert"> | 43 | <div class="insert"> |
43 | <iframe id="insert" name="insert" src="about:blank" width="95%" height="300"> | 44 | <iframe id="insert" name="insert" src="about:blank" width="95%" height="300"> |
44 | <p>I wanted to put an <iframe> here, but your browser does not seem to | 45 | <p>I wanted to put an <iframe> here, but your browser does not seem to |
45 | support it. That is okay, it still will open links somehow.</p> | 46 | support it. That is okay, it still will open links somehow.</p> |
46 | </iframe> | 47 | </iframe> |
47 | </div> | 48 | </div> |
48 | 49 | ||
49 | </%method> | 50 | </%method> |