mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-06 21:46:24 -07:00
Use ServeError instead of ServeErrorPage when handling upload errors
This commit is contained in:
parent
49d9b0ae20
commit
d62520591a
3 changed files with 61 additions and 29 deletions
|
@ -3,7 +3,6 @@ package gcsql
|
|||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gochan-org/gochan/pkg/events"
|
||||
"github.com/gochan-org/gochan/pkg/gcutil"
|
||||
)
|
||||
|
||||
|
@ -53,14 +52,6 @@ func (p *Post) AttachFile(upload *Upload) error {
|
|||
if upload == nil {
|
||||
return nil // no upload to attach, so no error
|
||||
}
|
||||
_, err, recovered := events.TriggerEvent("incoming-upload", upload)
|
||||
if recovered {
|
||||
return events.ErrRecovered
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
const query = `INSERT INTO DBPREFIXfiles (
|
||||
post_id, file_order, original_filename, filename, checksum, file_size,
|
||||
is_spoilered, thumbnail_width, thumbnail_height, width, height)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue