beego / samples

An open source project for beego sample applications.
Apache License 2.0
914 stars 1.25k forks source link

fix: abort handler manually after abnormal closure #40

Open nichtsen opened 2 years ago

nichtsen commented 2 years ago

i had ran the chatroom example on my local machine, however, when user closed the tab on browser, the handler just crashed with the following logs:

`[panic.go:838] the request url is /ws/join

[panic.go:838] Handler crashed with error can't find templatefile in the path:views/websocketcontroller/join.tpl `

it seems that beego trys to find template and render after /ws/join handler return, which is not neccessary in the case. Instead, abort handler manually is suitable.