Add diagnostics info to warning #314
This commit is contained in:
parent
dbd5911a2a
commit
842be0ba85
@ -27,12 +27,19 @@ BEGIN
|
|||||||
RAISE WARNING 'whatever';
|
RAISE WARNING 'whatever';
|
||||||
END;
|
END;
|
||||||
<% elsif multi_field %>
|
<% elsif multi_field %>
|
||||||
|
DECLARE
|
||||||
|
_returned_sqlstate TEXT;
|
||||||
|
_message_text TEXT;
|
||||||
|
_pg_exception_context TEXT;
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>) INTO ret;
|
SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>) INTO ret;
|
||||||
RETURN ret;
|
RETURN ret;
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
WHEN OTHERS THEN
|
WHEN OTHERS THEN
|
||||||
RAISE WARNING 'whatever';
|
GET STACKED DIAGNOSTICS _returned_sqlstate = RETURNED_SQLSTATE,
|
||||||
|
_message_text = MESSAGE_TEXT,
|
||||||
|
_pg_exception_context = PG_EXCEPTION_CONTEXT;
|
||||||
|
RAISE WARNING USING ERRCODE = _returned_sqlstate, MESSAGE = _message_text, DETAIL = _pg_exception_context;
|
||||||
RETURN ret;
|
RETURN ret;
|
||||||
END;
|
END;
|
||||||
<% else %>
|
<% else %>
|
||||||
|
Loading…
Reference in New Issue
Block a user