How to customize Assitants using Exception Filter?

delphi package - automated exception handling

How to customize Assitants using Exception Filter?

Postby FredS » Thu Jun 08, 2017 8:03 pm

I was hoping to use the Exception Filter to create unique Assistant criteria for each Filter.

To keep it simple:
Filter1 is setup to only prompt for Contact Info.
It prompts with the correct assistant but never continues to Mailto, this is either wrong or I am missing something..
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Re: How to customize Assitants using Exception Filter?

Postby madshi » Wed Jun 14, 2017 9:19 am

The assistant's don't include mailing functionality. The assistant's are just GUIs that add information to the IMEException interface. If you want the bug report to be sent, that needs to be explicitly triggered somehow.

Can you tell me a bit more about what exactly you want to achieve?
madshi
Site Admin
 
Posts: 9469
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to customize Assitants using Exception Filter?

Postby FredS » Wed Jun 14, 2017 5:21 pm

madshi wrote:The assistant's don't include mailing functionality. The assistant's are just GUIs that add information to the IMEException interface. If you want the bug report to be sent, that needs to be explicitly triggered somehow.

Can you tell me a bit more about what exactly you want to achieve?


Sure, I added a "Tell Us" button to a dialog that I show when an exception occurs within a known area.

Lets take db creation as an example. While the db is being created any errors are already posted to my log file and that file is included in the MAD Error submission so I really don't need to have the user add "Just Started the App" as an explanation of what he was doing. It would be best if the Assistant for ETellUS does not prompt for that info.
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Re: How to customize Assitants using Exception Filter?

Postby madshi » Thu Jun 15, 2017 7:10 am

So it seems that when the user pressese the "Tell Us" button, you manually raise an ETellUs exception?

So what do you want to happen exactly when the user processes the "Tell Us" button? And how does that differ from what you want to happen for normal exceptions?
madshi
Site Admin
 
Posts: 9469
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to customize Assitants using Exception Filter?

Postby FredS » Thu Jun 15, 2017 4:05 pm

madshi wrote:So it seems that when the user pressese the "Tell Us" button, you manually raise an ETellUs exception?

So what do you want to happen exactly when the user processes the "Tell Us" button? And how does that differ from what you want to happen for normal exceptions?


The default assistant is setup to check email and ask for input, I want to skip the input on ETellUs.
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Re: How to customize Assitants using Exception Filter?

Postby madshi » Thu Jun 15, 2017 5:01 pm

That does not really answer my question fully. I'm only getting half the picture here.

Again: What do you want to happen exactly when the user processes the "Tell Us" button?
madshi
Site Admin
 
Posts: 9469
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to customize Assitants using Exception Filter?

Postby FredS » Thu Jun 15, 2017 5:27 pm

madshi wrote:That does not really answer my question fully. I'm only getting half the picture here.

Again: What do you want to happen exactly when the user processes the "Tell Us" button?


Hmm, OK then.. Obviously the Filter isn't doing what I would expect it to do so I have already ditched that.

Now ETellUS does exactly what all other unhandled exceptions do but I don't what the Details Form to show for that exception.

All Assistants use:
- ContactForm
- DetailsForm

I want to skip the DetailsForm for ETellUs but continue normally through the ExceptionHandlers.
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Re: How to customize Assitants using Exception Filter?

Postby madshi » Thu Jun 15, 2017 6:02 pm

I'm sorry, but you're still not answering my question. Your first sentence tells me what you did so far. Your second sentence tells me what you *don't* want. Your last sentence tells me what you want to skip. But not a single of your sentences tells me what exactly you want to happen when the user presses that button. You're making it really hard for me. I asked a very specific and very simple question, and I require an answer which is to the point of what I asked.

Let me give you some examples of answers that would properly answer my question:

1) When the user presses that button, I want the exception box to appear. And when the user then presses the "send bug report" button, I want the normal sending, but without the DetailsForm.
2) When the user presses that button, I want the send assistant to show up immediately (no exception box), but without the DetailsForm.
3) When the user presses that button, I want to format C:\.
4) When the user presses that button, I want [...].

Right now I don't know if it's 1) or 2) or something else you want.
madshi
Site Admin
 
Posts: 9469
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to customize Assitants using Exception Filter?

Postby FredS » Thu Jun 15, 2017 6:12 pm

madshi wrote:I'm sorry, but you're still not answering my question. Your first sentence tells me what you did so far. Your second sentence tells me what you *don't* want. Your last sentence tells me what you want to skip. But not a single of your sentences tells me what exactly you want to happen when the user presses that button. You're making it really hard for me. I asked a very specific and very simple question, and I require an answer which is to the point of what I asked.

Let me give you some examples of answers that would properly answer my question:

1) When the user presses that button, I want the exception box to appear. And when the user then presses the "send bug report" button, I want the normal sending, but without the DetailsForm.
2) When the user presses that button, I want the send assistant to show up immediately (no exception box), but without the DetailsForm.
3) When the user presses that button, I want to format C:\.
4) When the user presses that button, I want [...].

Right now I don't know if it's 1) or 2) or something else you want.


1) When the user presses that button, I want the send assistant to show up immediately (no exception box), but without the DetailsForm.
2) Then I want to continue as a normal exception would by eventually triggering the ExceptAction handler with eaSendBugReport2
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Re: How to customize Assitants using Exception Filter?

Postby madshi » Thu Jun 15, 2017 6:28 pm

Do you absolutely need part 2)?

What you could instead of raising a dummy exception:

Code: Select all
with NewException() do
begin
  SendAssistant := 'TellUsAssistant';
  SendBugReport();
end;

Right now I'm not sure if doing this also does part 2). Could be.
madshi
Site Admin
 
Posts: 9469
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to customize Assitants using Exception Filter?

Postby FredS » Thu Jun 15, 2017 6:53 pm

madshi wrote:Do you absolutely need part 2)?

What you could instead of raising a dummy exception:

Code: Select all
with NewException() do
begin
  SendAssistant := 'TellUsAssistant';
  SendBugReport();
end;

Right now I'm not sure if doing this also does part 2). Could be.


It doesn't do part 2 but first things first:

From MES file
Code: Select all
Assistant4=ContactOnly|Send Assistant|ContactForm


This shows no assistant:
Code: Select all
  with NewException() do begin
    SendAssistant := 'ContactOnly';
    SendBugReport();
  end;
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Re: How to customize Assitants using Exception Filter?

Postby madshi » Thu Jun 15, 2017 7:33 pm

The other solution would be to stick with the ETellUs exception, and then in an exception handler set "exceptIntf.ShowSettings := ssNothing". This hides the exception box. And then "exceptIntf.SendAssistant := '...'" should switch the assistant. Do you have automatic sending activated? I'm not completely sure if it gets executed if you hide the exception box, but I think it should.

Not sure why setting the SendAssistant doesn't seem to work for you. Does it work if you switch to one of the other assistants instead?
madshi
Site Admin
 
Posts: 9469
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to customize Assitants using Exception Filter?

Postby FredS » Thu Jun 15, 2017 8:01 pm

madshi wrote:The other solution would be to stick with the ETellUs exception, and then in an exception handler set "exceptIntf.ShowSettings := ssNothing". This hides the exception box. And then "exceptIntf.SendAssistant := '...'" should switch the assistant. Do you have automatic sending activated? I'm not completely sure if it gets executed if you hide the exception box, but I think it should.


None of this works, pretty much retracing my steps when I tried to get this to work earlier with Filters.
First none of that does anything with NewException() I needed to raise ETellUS, then ssNothing does nothing, ssAssistant brings up the full exception box but does display the correct Assistant after that. Of course that doesn't help me..

So unless you actually have a "functioning" way to do this I am just going to leave it..

madshi wrote:Not sure why setting the SendAssistant doesn't seem to work for you. Does it work if you switch to one of the other assistants instead?


I used PrintAssistant and same deal.
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Re: How to customize Assitants using Exception Filter?

Postby madshi » Fri Jun 16, 2017 6:58 am

ssNothing doing nothing, is that when using raise ETellUs, or when using NewException?
madshi
Site Admin
 
Posts: 9469
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to customize Assitants using Exception Filter?

Postby FredS » Fri Jun 16, 2017 4:24 pm

madshi wrote:ssNothing doing nothing, is that when using raise ETellUs, or when using NewException?


New Project nothing but default settings:
Code: Select all
procedure TForm1.btRaiseClick(Sender: TObject);
begin
  raise Exception.Create('Error Message');
end;

procedure TForm1.MadExceptionHandler1Exception(const exceptIntf: IMEException; var handled: Boolean);
begin
  exceptIntf.ShowSetting := ssNothing;
  exceptIntf.SendAssistant := 'PrintAssistant';
end;


I get a "Please Wait" for a second or two then nothing. Only MAILTO is setup on this project.
FredS
 
Posts: 79
Joined: Mon May 11, 2015 9:42 pm

Next

Return to madExcept

Who is online

Users browsing this forum: No registered users and 5 guests

cron