diff options
-rw-r--r-- | transform/livereloadinject.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/transform/livereloadinject.go b/transform/livereloadinject.go index 0973841b3..4f572b57c 100644 --- a/transform/livereloadinject.go +++ b/transform/livereloadinject.go @@ -2,11 +2,16 @@ package transform import ( "bytes" - + jww "github.com/spf13/jwalterweatherman" "github.com/spf13/viper" ) func LiveReloadInject(content []byte) []byte { + defer func() { + if r := recover(); r != nil { + jww.ERROR.Println("Recovered in LiveReloadInject", r) + } + }() match := []byte("</body>") port := viper.GetString("port") replace := []byte(`<script>document.write('<script src="http://' |