Skip to content

Commit 68d3746

Browse files
committed
UY-1439 fix 500 error code, switch og level in
OAuthTokenStatisticPublisher
1 parent 2ef32a9 commit 68d3746

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

oauth/src/main/java/pl/edu/icm/unity/oauth/as/token/access/OAuthTokenStatisticPublisher.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import pl.edu.icm.unity.engine.api.authn.LoginSession;
2525
import pl.edu.icm.unity.engine.api.idp.statistic.IdpStatisticEvent;
2626
import pl.edu.icm.unity.exceptions.EngineException;
27+
import pl.edu.icm.unity.exceptions.InternalException;
2728
import pl.edu.icm.unity.oauth.as.OAuthASProperties;
2829
import pl.edu.icm.unity.oauth.as.OAuthRequestValidator;
2930
import pl.edu.icm.unity.oauth.as.OAuthSystemAttributesProvider;
@@ -72,7 +73,7 @@ void reportFailAsLoggedClient()
7273
LoginSession loginSession = InvocationContext.getCurrent().getLoginSession();
7374
if (loginSession == null)
7475
{
75-
log.error("Can not retrieve identity of the OAuth client, skippig error reporting");
76+
log.debug("Can not retrieve identity of the OAuth client, skippig error reporting");
7677
return;
7778
}
7879

@@ -84,7 +85,7 @@ void reportFailAsLoggedClient()
8485

8586
} catch (Exception e)
8687
{
87-
log.error("Can not retrieving identity of the OAuth client", e);
88+
log.debug("Can not retrieving identity of the OAuth client", e);
8889
return;
8990
}
9091

@@ -96,7 +97,7 @@ void reportFailAsLoggedClient()
9697
clientName = getClientName(clientEntity);
9798
} catch (Exception e)
9899
{
99-
log.error("Can not retrieving client name attribute of the OAuth client", e);
100+
log.debug("Can not retrieving client name attribute of the OAuth client", e);
100101
return;
101102
}
102103

@@ -112,8 +113,7 @@ private String getClientName(EntityParam clientEntity)
112113
attrs = unsecureAttributesMan.getAllAttributes(clientEntity, true, oauthGroup, null, false);
113114
} catch (EngineException e)
114115
{
115-
log.error("Problem retrieving attributes of the OAuth client", e);
116-
throw new InternalError("Internal error, can not retrieve OAuth client's data");
116+
throw new InternalException("Internal error, can not retrieve OAuth client's data", e);
117117
}
118118

119119
Optional<AttributeExt> clientNameAttr = attrs.stream()
@@ -140,7 +140,7 @@ void reportSuccess(String clientUsername, String clientName, EntityParam owner)
140140
new ApplicationId(clientUsername), Instant.now());
141141
} catch (EngineException e)
142142
{
143-
log.error("Can not set last access attribute", e);
143+
log.debug("Can not set last access attribute", e);
144144
}
145145

146146
}
@@ -175,7 +175,7 @@ private Endpoint getEndpoint()
175175
}
176176
} catch (Exception e)
177177
{
178-
log.error("Can not get relateed OAauth authz endpoint for token endpoint " + endpoint.getName(), e);
178+
log.debug("Can not get relateed OAauth authz endpoint for token endpoint " + endpoint.getName(), e);
179179
return endpoint.getEndpoint();
180180
}
181181
}

0 commit comments

Comments
 (0)