SEBSERV-417 improved error and waning handling and logging
This commit is contained in:
parent
07391430c4
commit
dc98f451fa
2 changed files with 3 additions and 3 deletions
|
@ -563,13 +563,13 @@ public abstract class MoodleUtils {
|
|||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static final class FullConnectionApplyResponse {
|
||||
@JsonProperty("success")
|
||||
public final int success;
|
||||
public final boolean success;
|
||||
@JsonProperty("warnings")
|
||||
public final Collection<Warning> warnings;
|
||||
|
||||
@JsonCreator
|
||||
public FullConnectionApplyResponse(
|
||||
@JsonProperty("success") final int success,
|
||||
@JsonProperty("success") final boolean success,
|
||||
@JsonProperty("warnings") final Collection<Warning> warnings) {
|
||||
|
||||
this.success = success;
|
||||
|
|
|
@ -137,7 +137,7 @@ public class MoodlePluginFullIntegration implements FullLmsIntegrationAPI {
|
|||
response,
|
||||
MoodleUtils.FullConnectionApplyResponse.class);
|
||||
|
||||
if (fullConnectionApplyResponse.success == 0 && !fullConnectionApplyResponse.warnings.isEmpty()) {
|
||||
if (!fullConnectionApplyResponse.success && !fullConnectionApplyResponse.warnings.isEmpty()) {
|
||||
fullConnectionApplyResponse.warnings.stream()
|
||||
.filter(w -> Objects.equals(w.warningcode, "connectiondoesntmatch"))
|
||||
.findFirst()
|
||||
|
|
Loading…
Reference in a new issue