Hello,
Simple question this one:
Has anyone dabbled with feeding back a more helpful error from a failed BCA/VBA job by updating ERROR_TEXT on DS_PENDING_JOB?
One of the frequent complaints from users is the unhelpful
(303) Error with no ErrorHandler with BreakOnVBAError = FALSE
At the moment we write errors to logfiles etc, but for the end-user using Console within BusObj reporter, it would be nice to give them a reason why the job failed, without them having to phone us to look at a log file.
I know there would be the issues of direct repo modification, and how a job could identify itself to update on the table, but just wondered if this was a complete non-starter or not.
Maybe I should have articulated the problem better…
We have an in-house macro that lets a user ‘publish’ a report to an online system on our intranet, via the BCA which has a macro that refreshes the report for a set of given parameters.
If there is an error with the report (eg. it uses a spreadsheet as a DP that doesn’t exist on the BCA) then the report will fail. We capture the error (Error: 109 Connection or SQL sentence error: (DA0005):, or whatever) to a logfile, but ideally I’d like to mirror this onto the BCA console.
So it’s more a case of reporting the error within a report, rather than an actual error in the VBA code.
I think prd_cv1’s suggestion is still valid. The Break on VBA is usually caused by and error that is not handle. Most generally, there is not a error handler in the reprot macro.
hmmm, i’m not convinced .
If there is an error in the report (ie. when refreshing a DP, not running a macro), that would normally be communicated to the user interactively, but occurs when the report is run on the BCA, then this error ought to be able to be fed back to the user.
There is an error handler in the macro, that captures the error and logs it to file, and then raises an error so that the user can see that the report failed - just not why it failed.
Well, first of all, the “error with no error handler” means that you have aborted out of your code in an unexpected fashion. If you handle all errors, you might consider experimenting with the ability to raise user errors.
I don’t recall the exact function, but there is a way to raise you own error conditions. I would hope (expect is too strong a word ;-)) that BusinessObjects would take your custom error number and custom error code and include in the BCA table. That way you avoid having to directly update the table. Which would be a good thing. 8)
That’s what my code’s doing - raising a custom error, after logging the report refresh error to file
Err.Raise 1001, "", "HTML Publishing Terminated"
One would hope that indeed , but the code above just causes the 303 error to be reported in BCA, whereas what one would expect to see is 1001 HTML Publishing Terminated (or whatever else was specified in the Err.Raise, ie. the report refresh error)
It sounds like you are already doing what I would have tried. At the moment I don’t have any other tricks to suggest.
If you do want to update the table, you might want to make that a separate process. Have a program that scans your output logs from your VBA, and on some periodic basis it updates the pending jobs table with your custom error message. I would not try to do it within the job itself, as you may find that BCA replaces you custom message with its own once the job finishes.
Thanks Dave, at least my understanding has been confirmed. I think I’ll probably do as you suggest and have a separate process to scan for errors, but do something like email the users, rather than mess with the repo tables for something which is only a ‘nice to have’ really.