From e53a39875e882c984108cb431ab0c29a2639e180 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Tue, 13 Dec 2016 16:51:11 +0100 Subject: [PATCH] Implement the multi_row case #314 --- .../templates/25_exception_safe_public_functions.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/renderer/templates/25_exception_safe_public_functions.erb b/client/renderer/templates/25_exception_safe_public_functions.erb index 7bf7920..04782d8 100644 --- a/client/renderer/templates/25_exception_safe_public_functions.erb +++ b/client/renderer/templates/25_exception_safe_public_functions.erb @@ -19,8 +19,13 @@ BEGIN END IF; <% if multi_row %> - RETURN QUERY - SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>); + BEGIN + RETURN QUERY + SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>); + EXCEPTION + WHEN OTHERS THEN + RAISE WARNING 'whatever'; + END; <% elsif multi_field %> SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>) INTO ret; RETURN ret;