# FormatService

**URL:** <https://techcommunity.softwareag.com/t/formatservice/107465>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [October 5, 2004, 11:45pm UTC](https://techcommunity.softwareag.com/t/formatservice/107465 "2004-10-05T23:45:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![braindrain](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@braindrain](https://techcommunity.softwareag.com/u/braindrain)\
**Post date:** [October 5, 2004, 11:45pm UTC](https://techcommunity.softwareag.com/t/formatservice/107465/1 "2004-10-05T23:45:59Z")

</div>

Guys,  
I am parsing a file using convertToValues. FOr one of the fields, I am using the FormatService to format the date.

```
But, some times, the input value is not in the required format and the convertToValues is not throwing exceptions. 

The format date service expects date of format dd-MMM-yy, and returns yyyy-MM-dd hh:mm:ss.SSS. When i pass in the wrong format, its not throwing any exception nor is it coming out of the service.

```

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [October 6, 2004, 2:13am UTC](https://techcommunity.softwareag.com/t/formatservice/107465/2 "2004-10-06T02:13:05Z")

</div>

Brian,

You have to put a Try/Catch sequence in the FormatService logic and exit with SignalFailure,so that if wrong date format then it will be catched and raise an exception in the flow.

HTH,  
RMG.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:04pm UTC](https://techcommunity.softwareag.com/t/formatservice/107465/3 "2021-04-02T15:04:49Z")

</div>


