DA14683: Can't sleep with debugger attached, where in the SDK does it abort?

System:

DA14683

SDK = 1.0.14.1081 (last updated in 2018)

Situation:

I understand that having the debugger attached will keep the system from going to sleep.  What I am wondering is, Where in the SDK sleep code is it checking for an attached debugger and what sort of error/response happens when the SDK detects the debugger is attached?

Questions:

1) Where in the SDK sleep code is it checking if there is an attached debugger (file and line please)?

2) If the SDK sleep code detects an attached debugger, what does it do?  Does it set any flags, return an error value, or just abort sleep without any explanation? 

3) If there a way to detect that the system aborted sleep because of an attached debugger?