mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 19:06:12 +02:00
Rescue Fluent::ConfigError
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
fe32983c0f
commit
c55038ed17
@ -23,6 +23,8 @@ class ApiController < ApplicationController
|
||||
preview = RegexpPreview.processor(params[:parse_type]).new(params[:file], params[:parse_type], plugin_config)
|
||||
|
||||
render json: preview.matches
|
||||
rescue Fluent::ConfigError => ex
|
||||
render json: { error: "#{ex.class}: #{ex.message}" }
|
||||
end
|
||||
|
||||
def grok_to_regexp
|
||||
|
||||
@ -139,7 +139,12 @@ $(document).ready(() => {
|
||||
}
|
||||
}).then(
|
||||
(result) => {
|
||||
this.updateHighlightedLines(result.matches)
|
||||
if (result.matches) {
|
||||
this.updateHighlightedLines(result.matches)
|
||||
} else {
|
||||
console.error(result.error)
|
||||
this.previewError = result.error
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
this.highlightedLines = null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user