echo 'not dart' | dartfmt and echo 'not dart' | dart format both produce equivalent error messages, but dartfmt exits with code 65 while dart format exits with 0.
We use the exit code in dart-vim-plugin to know whether the output should be treated as the formatted file, or as errors. Unfortunately in vim it isn't trivial to distinguish between stderr and stdout so using the output stream to determine success would take some additional hacking and running the command twice.