# Quirks in message(SEND\_ERROR)

**URL:** https://discourse.cmake.org/t/quirks-in-message-send-error/4723
**Category:** Code
**Created:** [December 20, 2021, 3:48pm UTC](https://discourse.cmake.org/t/quirks-in-message-send-error/4723 "2021-12-20T15:48:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![CaptainCrowbar](https://discourse.cmake.org/user_avatar/discourse.cmake.org/captaincrowbar/32/2048_2.png) [@CaptainCrowbar](https://discourse.cmake.org/u/CaptainCrowbar)
#### Post date: [December 20, 2021, 3:48pm UTC](https://discourse.cmake.org/t/quirks-in-message-send-error/4723/1 "2021-12-20T15:48:14Z")

</div>

I have a Cmake function that looks like this (simplified for illustration):

```auto
function(check_file_exists file url)
    find_file(found ${file})
    if(NOT found)
        message(SEND_ERROR "File not found: ${file}\nDownload it from: ${url}")
    endif()
endfunction()

```

It works but has a couple of annoying behaviours:  
(1) Why does Cmake write two linefeeds for every `\n` in the message?  
(2) Is there any way to suppress the stack trace that gets printed after the message? It’s not a Cmake error so the stack trace is just useless noise.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 21, 2021, 12:30pm UTC](https://discourse.cmake.org/t/quirks-in-message-send-error/4723/2 "2021-12-21T12:30:28Z")

</div>

I think you also want `NO_CACHE` there (otherwise each subsequent call will reuse the `found` cache variable and not actually search for anything).

No, there’s no way to suppress the stack trace (because CMake doesn’t know that this is an “informational” error and knowing “where it came from” is very helpful in general.
