mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 05:30:48 +08:00
DEV: Update call sites using BaseStore#download but expecting exceptions (#21551)
In #21498, we split `BaseStore#download` into a "safe" version which returns nil on errors, and an "unsafe" version which raises an exception, which was the old behaviour of `#download`. This change updates call sites that used the old `#download`, which raised exceptions, to use the new `#download!` to preserve behaviour (and silence deprecation warnings.) It also silences the deprecation warning in tests.
This commit is contained in:
@ -105,7 +105,7 @@ module FileStore
|
||||
end
|
||||
|
||||
def download(object, max_file_size_kb: nil, print_deprecation: true)
|
||||
Discourse.deprecate(<<~MESSAGE, output_in_test: true) if print_deprecation
|
||||
Discourse.deprecate(<<~MESSAGE) if print_deprecation
|
||||
In a future version `FileStore#download` will no longer raise an error when the
|
||||
download fails, and will instead return `nil`. If you need a method that raises
|
||||
an error, use `FileStore#download!`, which raises a `FileStore::DownloadError`.
|
||||
|
Reference in New Issue
Block a user