Skip to content

Commit

Permalink
Team error resource response
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhav-db committed Aug 24, 2023
1 parent 4682c26 commit caddf98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.finos.springbot.teams.conversations;

import com.microsoft.bot.schema.ResourceResponse;

public class TeamsErrorResourceResponse extends ResourceResponse {

Throwable e;

public TeamsErrorResourceResponse(String id, Throwable e ) {
super(id);
this.e = e;
}

public Throwable getThrowable() {
return e;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.finos.springbot.teams.TeamsException;
import org.finos.springbot.teams.content.TeamsAddressable;
import org.finos.springbot.teams.conversations.TeamsErrorResourceResponse;
import org.finos.springbot.teams.history.StorageIDResponseHandler;
import org.finos.springbot.teams.history.TeamsHistory;
import org.finos.springbot.teams.response.templating.EntityMarkupTemplateProvider;
Expand Down Expand Up @@ -194,7 +195,7 @@ private BiFunction<? super ResourceResponse, Throwable, ResourceResponse> handle
} catch (JsonProcessingException e1) {
}
} else {
LOG.error("message:\n"+out);
LOG.error("message:\n"+out);
}

if(!(t instanceof ErrorResponse)) {
Expand All @@ -204,6 +205,7 @@ private BiFunction<? super ResourceResponse, Throwable, ResourceResponse> handle
initErrorHandler();
eh.handleError(e);
Action.CURRENT_ACTION.set(Action.NULL_ACTION);
rr = new TeamsErrorResourceResponse(address.getKey(), e);
} else if(rr != null) {
performStorage(address, data, teamsState);
}
Expand Down

0 comments on commit caddf98

Please sign in to comment.