Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ecsec Public
reqesidta-prototype
client-signer
Commits
1b2f8fd9
Commit
1b2f8fd9
authored
Sep 26, 2019
by
Tobias Wich
Browse files
Expose minor code of the process to the activator
parent
9efe096e
Changes
3
Hide whitespace changes
Inline
Side-by-side
addon/src/main/java/org/openecard/addon/bind/AuxDataKeys.java
View file @
1b2f8fd9
...
...
@@ -36,5 +36,6 @@ public class AuxDataKeys {
public
static
final
String
REDIRECT_LOCATION
=
PREFIX
+
"redirect_location"
;
public
static
final
String
RESPONSE_HEADERS
=
PREFIX
+
"response_headers"
;
public
static
final
String
MINOR_PROCESS_RESULT
=
PREFIX
+
"minor_result"
;
}
addons/tr03112/src/main/java/org/openecard/binding/tctoken/TCTokenHandler.java
View file @
1b2f8fd9
...
...
@@ -381,16 +381,20 @@ public class TCTokenHandler {
}
else
if
(
innerException
instanceof
PAOSConnectionException
)
{
response
.
setResult
(
WSHelper
.
makeResultError
(
ResultMinor
.
TRUSTED_CHANNEL_ESTABLISHMENT_FAILED
,
w
.
getLocalizedMessage
()));
response
.
setAdditionalResultMinor
(
ECardConstants
.
Minor
.
Disp
.
COMM_ERROR
);
}
else
if
(
innerException
instanceof
InterruptedException
)
{
response
.
setResultCode
(
BindingResultCode
.
INTERRUPTED
);
response
.
setResult
(
WSHelper
.
makeResultError
(
ResultMinor
.
CANCELLATION_BY_USER
,
errorMsg
));
response
.
setAdditionalResultMinor
(
ECardConstants
.
Minor
.
App
.
SESS_TERMINATED
);
}
else
if
(
innerException
instanceof
DocumentValidatorException
)
{
errorMsg
=
LANG_TR
.
translationForKey
(
SCHEMA_VALIDATION_FAILED
);
// it is ridiculous, that this should be a client error, but the test spec demands this
response
.
setResult
(
WSHelper
.
makeResultError
(
ResultMinor
.
CLIENT_ERROR
,
w
.
getMessage
()));
response
.
setAdditionalResultMinor
(
ECardConstants
.
Minor
.
SAL
.
Support
.
SCHEMA_VAILD_FAILED
);
}
else
{
errorMsg
=
createMessageFromUnknownError
(
w
);
response
.
setResult
(
WSHelper
.
makeResultError
(
ResultMinor
.
CLIENT_ERROR
,
w
.
getMessage
()));
response
.
setAdditionalResultMinor
(
ECardConstants
.
Minor
.
App
.
UNKNOWN_ERROR
);
}
showErrorMessage
(
errorMsg
);
...
...
@@ -548,7 +552,9 @@ public class TCTokenHandler {
private
String
createResponseFromWsEx
(
WSException
ex
,
TCTokenResponse
response
)
{
String
errorMsg
;
switch
(
ex
.
getResultMinor
())
{
String
minor
=
ex
.
getResultMinor
();
switch
(
minor
)
{
case
ECardConstants
.
Minor
.
Disp
.
TIMEOUT
:
case
ECardConstants
.
Minor
.
SAL
.
CANCELLATION_BY_USER
:
case
ECardConstants
.
Minor
.
IFD
.
CANCELLATION_BY_USER
:
...
...
@@ -595,6 +601,9 @@ public class TCTokenHandler {
errorMsg
=
LANG_TR
.
translationForKey
(
ERROR_WHILE_AUTHENTICATION
);
response
.
setResult
(
WSHelper
.
makeResultError
(
ResultMinor
.
SERVER_ERROR
,
errorMsg
));
}
response
.
setAdditionalResultMinor
(
minor
);
return
errorMsg
;
}
...
...
addons/tr03112/src/main/java/org/openecard/binding/tctoken/TCTokenResponse.java
View file @
1b2f8fd9
/****************************************************************************
* Copyright (C) 2012-201
4
ecsec GmbH.
* Copyright (C) 2012-201
9
ecsec GmbH.
* All rights reserved.
* Contact: ecsec GmbH (info@ecsec.de)
*
...
...
@@ -42,10 +42,12 @@ import org.openecard.common.util.UrlBuilder;
*
* @author Moritz Horsch
* @author Hans-Martin Haase
* @author Tobias Wich
*/
public
class
TCTokenResponse
extends
BindingResult
{
private
static
final
I18n
lang
=
I18n
.
getTranslation
(
"tr03112"
);
private
static
final
I18n
LANG
=
I18n
.
getTranslation
(
"tr03112"
);
private
Result
result
;
private
TCToken
token
;
private
Future
<?>
bindingTask
;
...
...
@@ -71,6 +73,10 @@ public class TCTokenResponse extends BindingResult {
this
.
result
=
result
;
}
public
void
setAdditionalResultMinor
(
String
minor
)
{
this
.
addAuxResultData
(
AuxDataKeys
.
MINOR_PROCESS_RESULT
,
minor
);
}
/**
* Sets the TCToken as received in the request.
*
...
...
@@ -151,7 +157,7 @@ public class TCTokenResponse extends BindingResult {
}
catch
(
URISyntaxException
ex
)
{
// this is a code failure as the URLs are verified upfront
// TODO: translate when exception changes
throw
new
IllegalArgumentException
(
lang
.
getOriginalMessage
(
INVALID_URL
),
ex
);
throw
new
IllegalArgumentException
(
LANG
.
getOriginalMessage
(
INVALID_URL
),
ex
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment