mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 03:12:24 -05:00
[bugfix] Don't return Internal Server Error when searching for URIs that don't return AP JSON (#2550)
* [bugfix] Don't return Internal Server Error when searching for URIs that don't return AP JSON * don't pass map pointer
This commit is contained in:
parent
118897187a
commit
ad6f75694e
3 changed files with 70 additions and 19 deletions
|
|
@ -55,9 +55,15 @@ func SetUnretrievable(err error) error {
|
|||
return errors.WithValue(err, unrtrvableKey, struct{}{})
|
||||
}
|
||||
|
||||
// IsWrongType checks error for a stored "wrong type" flag. Wrong type
|
||||
// indicates that an ActivityPub URI returned a type we weren't expecting:
|
||||
// Statusable instead of Accountable, or vice versa, for example.
|
||||
// IsWrongType checks error for a stored "wrong type" flag.
|
||||
// Wrong type indicates that an ActivityPub URI returned a
|
||||
// type we weren't expecting. For example:
|
||||
//
|
||||
// - HTML instead of JSON.
|
||||
// - Normal JSON instead of ActivityPub JSON.
|
||||
// - Statusable instead of Accountable.
|
||||
// - Accountable instead of Statusable.
|
||||
// - etc.
|
||||
func IsWrongType(err error) bool {
|
||||
_, ok := errors.Value(err, wrongTypeKey).(struct{})
|
||||
return ok
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue