# robot file/filter custom error message not show

**URL:** <https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203>\
**Category:** Transloadit\
**Tags:** tender-archive\
**Created:** [October 29, 2013, 4:22pm UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203 "2013-10-29T16:22:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Azevedo](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/francisco_azevedo/32/1632_2.png) [@Francisco\_Azevedo](https://community.transloadit.com/u/Francisco_Azevedo)\
**Post date:** [October 29, 2013, 4:22pm UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/1 "2013-10-29T16:22:00Z")

</div>

> Archived from the Transloadit support forum. Originally posted on October 29, 2013; details may be outdated, see [our docs](https://transloadit.com/docs/) for current behavior. [Original thread](https://web.archive.org/web/20150526055601/http://support.transloadit.com/discussions/problems/11143-robot-filefilter-custom-error-message-not-show)

Hi all,

I created a simple filter to check file extension and give error if file extension is not accepted.  
The problem is that tansload seem to ignore “error\_msg” parameter because when i test template, i really get error box but with standard message and not my custom message of “error\_msg”.  
Is this a bug?

best  
Francisco Azevedo

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [October 29, 2013, 5:22pm UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/2 "2013-10-29T17:22:00Z")

</div>

Hey Francisco,

can you please post the relevant code?

---

<div class="post-metadata">

**Author:** ![Francisco\_Azevedo](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/francisco_azevedo/32/1632_2.png) [@Francisco\_Azevedo](https://community.transloadit.com/u/Francisco_Azevedo)\
**Post date:** [October 29, 2013, 6:04pm UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/3 "2013-10-29T18:04:00Z")

</div>

Tim, i’m using transloadit template tester 🙂

Francisco Azevedo

---

<div class="post-metadata">

**Author:** ![Francisco\_Azevedo](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/francisco_azevedo/32/1632_2.png) [@Francisco\_Azevedo](https://community.transloadit.com/u/Francisco_Azevedo)\
**Post date:** [October 30, 2013, 10:29am UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/4 "2013-10-30T10:29:00Z")

</div>

Here goes a simple example:

```auto
"steps": {
    "files": {
      "robot": "/file/filter",
      "accepts": [
        [
          "${file.ext}",
          "==",
          "png"
        ]
      ],
      "error_on_decline": true,
      "error_msg": "Only png files are permitted"
    },
...

```

When i create a template with this sample code and try to test it on transloadit user-area, i get uploader standard error message when file is not “png” instead of “Only png files are permitted” message.

Best,  
Francisco Azevedo

---

<div class="post-metadata">

**Author:** ![Francisco\_Azevedo](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/francisco_azevedo/32/1632_2.png) [@Francisco\_Azevedo](https://community.transloadit.com/u/Francisco_Azevedo)\
**Post date:** [October 30, 2013, 5:23pm UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/5 "2013-10-30T17:23:00Z")

</div>

Hi again,

I think i found a strange behaviour with file/filter.  
Eg, imagine i want to use swf files (note this is just an example) and make sure uploaded files must be flash.. so with a mimetype “application/x-shockwave-flash”.

The problem is that, if i use “==” i get a transloadit parse error “Transloadit was unable to parse your accepts or declines array”.

If i use “regex” it works as expected.

Sounds strange to me..

Problem:  
@@@  
“steps”: {  
“files”: {  
“robot”: “/file/filter”,  
“accepts”: [  
[  
“${file.mime}”,  
“==”,  
“application/x-shockwave-flash”  
]  
],  
“error\_on\_decline”: true,  
“error\_msg”: “Only swf files are permitted”  
},  
…  
@@@

This version, works as expected:

@@@

```auto
"steps": {
"files": {
"robot": "/file/filter",
"accepts": [
[
"${file.mime}",
"regex",
"application/x-shockwave-flash"
]
],
"error_on_decline": true,
"error_msg": "Only swf files are permitted"
},

```

…  
@@@

Shouldn’t “file/parse” robot compare mime exact string with “==” operator instead of giving error? Why is this happening?

With “regex” i get my problem solved.

Best,  
Francisco Azevedo

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [October 31, 2013, 7:37am UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/6 "2013-10-31T07:37:00Z")

</div>

Hey Francisco,

the operator must be “=” and not “==” as per our docs.

But I see how people can get this wrong, so we are going to make “==” available, too.  
I just tested it again using “=” and it works as expected.

Kind regards,  
Tim

Co-Founder Transloadit  
@tim\_kos

---

<div class="post-metadata">

**Author:** ![Francisco\_Azevedo](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/francisco_azevedo/32/1632_2.png) [@Francisco\_Azevedo](https://community.transloadit.com/u/Francisco_Azevedo)\
**Post date:** [October 31, 2013, 8:54am UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/7 "2013-10-31T08:54:00Z")

</div>

Hi Tim,

You are right, we should use “=” instead of “==”.  
It’s working now. Thanks.

Best,  
Francisco Azevedo

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [November 1, 2013, 4:44am UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/8 "2013-11-01T04:44:00Z")

</div>

Most welcome.

I also made “==” and “===” work in the meantime.

Closing this.

Kind regards,  
Tim

Co-Founder Transloadit  
@tim\_kos

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/transloadit/original/1X/04ee57da0cb7ac8728a9ac5965c288164f4ce280.svg) [@system](https://community.transloadit.com/u/system)\
**Post date:** [October 7, 2026, 10:32am UTC](https://community.transloadit.com/t/robot-file-filter-custom-error-message-not-show/18203/9 "2026-10-07T10:32:35Z")

</div>


