# How to suppress or redirect \`FileIO\` error messages

**URL:** <https://discourse.julialang.org/t/how-to-suppress-or-redirect-fileio-error-messages/114573>\
**Category:** General Usage\
**Tags:** package, io, fileio\
**Created:** [May 22, 2024, 2:02pm UTC](https://discourse.julialang.org/t/how-to-suppress-or-redirect-fileio-error-messages/114573 "2024-05-22T14:02:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [May 22, 2024, 2:02pm UTC](https://discourse.julialang.org/t/how-to-suppress-or-redirect-fileio-error-messages/114573/1 "2024-05-22T14:02:44Z")

</div>

When loaders or savers throw errors, FileIO.jl outputs error messages to `stderr` and `stdout` without `Logging` functions or macros.  
The messages are helpful in most cases, but can mess up proper log handling.

```julia-repl
julia> using FileIO

julia> try; load(IOBuffer("\x93NUMPY!!!BROKEN!!!")); catch; end # just an example
Error encountered while load Stream{DataFormat{:NPY}, IOBuffer, Nothing}(IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=18, maxsize=Inf, ptr=1, mark=-1), nothing).

Fatal error:

julia> pkgversion(FileIO)
v"1.16.3"

julia> versioninfo()
Julia Version 1.10.3
Commit 0b4590a550 (2024-04-30 10:59 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

```

Of course we can use Supressor.jl as a general measure.  
Is there any way to suppress or redirect `FileIO`(-specific) error messages?  
Or is it possible to make changes related to that in FileIO.jl **v1**?

---

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [May 22, 2024, 2:27pm UTC](https://discourse.julialang.org/t/how-to-suppress-or-redirect-fileio-error-messages/114573/2 "2024-05-22T14:27:50Z")

</div>

In the first place, it should be fully expected that externally supplied files are broken or unsupported.  
The “Fatal error” seems to be too casual about “fate”.
