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
dad
cines-vitam-plugins
format-validator-plugin
Commits
34b7b4dc
Commit
34b7b4dc
authored
May 12, 2021
by
granier
Browse files
Fix: traitement de UnknownFormatException
parent
52ade6a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/gouv/vitam/worker/core/plugin/FormatValidatorPlugin.java
View file @
34b7b4dc
...
@@ -96,7 +96,14 @@ public class FormatValidatorPlugin extends ActionHandler {
...
@@ -96,7 +96,14 @@ public class FormatValidatorPlugin extends ActionHandler {
itemStatus
.
setEvDetailData
(
JsonHandler
.
unprettyPrint
(
object
));
itemStatus
.
setEvDetailData
(
JsonHandler
.
unprettyPrint
(
object
));
LOGGER
.
warn
(
"Erreur lors de le validation : {}, {}"
,
fileToValidate
,
fe
.
getMessage
());
LOGGER
.
warn
(
"Erreur lors de le validation : {}, {}"
,
fileToValidate
,
fe
.
getMessage
());
return
new
ItemStatus
(
FORMAT_VALIDATOR_PLUGIN
).
setItemsStatus
(
itemStatus
.
getItemId
(),
itemStatus
);
return
new
ItemStatus
(
FORMAT_VALIDATOR_PLUGIN
).
setItemsStatus
(
itemStatus
.
getItemId
(),
itemStatus
);
}
catch
(
Exception
e
)
{
}
catch
(
UnknownFormatException
e
)
{
final
ObjectNode
object
=
JsonHandler
.
createObjectNode
();
object
.
put
(
SedaConstants
.
EV_DET_TECH_DATA
,
e
.
getMessage
());
itemStatus
.
increment
(
StatusCode
.
KO
);
itemStatus
.
setEvDetailData
(
JsonHandler
.
unprettyPrint
(
object
));
LOGGER
.
warn
(
"Impossible d'identifier le format : {}, {}"
,
fileToValidate
,
e
.
getMessage
());
return
new
ItemStatus
(
FORMAT_VALIDATOR_PLUGIN
).
setItemsStatus
(
itemStatus
.
getItemId
(),
itemStatus
);
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"erreur lors de la validation du format"
+
e
.
getMessage
());
LOGGER
.
warn
(
"erreur lors de la validation du format"
+
e
.
getMessage
());
}
}
}
}
...
@@ -165,7 +172,7 @@ public class FormatValidatorPlugin extends ActionHandler {
...
@@ -165,7 +172,7 @@ public class FormatValidatorPlugin extends ActionHandler {
}
}
}
}
protected
Format
validateFormat
(
/*final DataObject dataObject,*/
final
File
file
)
throws
FormatErrorException
{
protected
Format
validateFormat
(
final
File
file
)
throws
FormatErrorException
,
UnknownFormatException
{
final
ValidatorBean
validator
=
new
ValidatorBean
();
final
ValidatorBean
validator
=
new
ValidatorBean
();
try
{
try
{
...
@@ -187,7 +194,7 @@ public class FormatValidatorPlugin extends ActionHandler {
...
@@ -187,7 +194,7 @@ public class FormatValidatorPlugin extends ActionHandler {
}
catch
(
final
IOException
e
)
{
}
catch
(
final
IOException
e
)
{
// throw new ValidateFormatException(depositId, e);
// throw new ValidateFormatException(depositId, e);
}
catch
(
UnknownFormatException
e
)
{
}
catch
(
UnknownFormatException
e
)
{
// TODO: handle exception
throw
e
;
}
}
...
...
Write
Preview
Markdown
is supported
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