_acs-templating__ad_return_exception_template (private)

 _acs-templating__ad_return_exception_template

Defined in packages/acs-templating/tcl/test/acs-integration-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_false aa_false (public) aa_log aa_log (public) aa_log_result aa_log_result (public) acs::test::reply_contains acs::test::reply_contains (public) acs::test::reply_has_status_code acs::test::reply_has_status_code (public) _acs-templating__ad_return_exception_template _acs-templating__ad_return_exception_template _acs-templating__ad_return_exception_template->aa_false _acs-templating__ad_return_exception_template->aa_log _acs-templating__ad_return_exception_template->aa_log_result _acs-templating__ad_return_exception_template->acs::test::reply_contains _acs-templating__ad_return_exception_template->acs::test::reply_has_status_code

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    set endpoint_name /acs-templating-test-ad-return-exception-template

    set url [acs::test::url]${endpoint_name}

    try {
        ns_register_proc GET $endpoint_name {
            set ::template::parse_level 0
            set errmsg "One custom error"
            set custom_message "One custom message"
            ad_return_exception_template -params {errmsg custom_message}  /packages/acs-subsite/lib/shared/db-error
            nsv_incr __acs-templating-test-ad-return-exception-template count
        }

        set d [ns_http run -method GET $url]

        acs::test::reply_has_status_code $d 500
        aa_false "No code was executed after returning"  [nsv_exists __acs-templating-test-ad-return-exception-template count]
        acs::test::reply_contains $d "One custom error"
        acs::test::reply_contains $d "One custom message"
        ns_unregister_op GET $endpoint_name


        ns_register_proc GET $endpoint_name {
            set ::template::parse_level 0
            ad_return_exception_template -status 404  -params {
                    {errmsg "Another custom error"}
                    {custom_message "Another custom message"}
                }  /packages/acs-subsite/lib/shared/db-error
            nsv_incr __acs-templating-test-ad-return-exception-template count
        }

        set d [ns_http run -method GET $url]

        acs::test::reply_has_status_code $d 404
        aa_false "No code was executed after returning"  [nsv_exists __acs-templating-test-ad-return-exception-template count]
        acs::test::reply_contains $d "Another custom error"
        acs::test::reply_contains $d "Another custom message"

    } finally {
        ns_unregister_op GET $endpoint_name
    }
}} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "ad_return_exception_template (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: