[ 
https://issues.apache.org/jira/browse/NIFI-13329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17851146#comment-17851146
 ] 

Matt Gilman commented on NIFI-13329:
------------------------------------

Thanks for clarifying. I wasn't reproducing correctly. I thought the mime type 
in the attribute was wrong. In this case the attribute was correct but the 
content was not of that type.

So in NiFi the attribute value drives which data viewer is used. In this case, 
it matched. The error that is happening is a function of this data viewer. The 
data viewer that handles JSON does not have explicit error handling for this 
case which is resulting in the error in your screenshot. This behavior also 
happened before Formatted was made the default. Previously, it required the 
user to select Formatted first. The downside currently, is that the user never 
gets the UI where they can attempt to change the mode.

The client/browser drives which mode we're in. We may be able to update this 
data viewer to catch the errors and instead return the content in its original 
form. But the UI would likely still reflect Formatted mode. The data viewers 
are actually multiple JSPs included together (header, content, footer). I don't 
think an error or change in the mode happening in the content can impact the 
header but I'll need to investigate. It's possible that even if we can't update 
the selected mode, it would be an improvement over what's happening here.

> Fallback to raw viewer when formatted viewer fails
> --------------------------------------------------
>
>                 Key: NIFI-13329
>                 URL: https://issues.apache.org/jira/browse/NIFI-13329
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Pierre Villard
>            Priority: Major
>         Attachments: Screenshot 2024-05-30 at 11.19.23.png
>
>
> The formatted viewer (based on the mime.type attribute) recently became the 
> default. In case the MIME type is wrong, this would return an error when 
> opening the flowfile's content. It could be nice to catch the error and 
> fallback to the raw viewer.
> !Screenshot 2024-05-30 at 11.19.23.png|width=611,height=150!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to