Valmiki Ramayana Aranya Kanda Sarga 40 Shloka 8
Original Shlokaदोषं गुणं वा सम्पृष्टस्त्वमेवं वक्तुमर्हसि। अपायं वाप्युपायं वा कार्यस्यास्य विनिश्चये।।3.40.8।।
1 source checked for this shloka
अस्य कार्यस्य in this task, विनिश्चये this decision, दोषम् demerits, गुणं वा or merit, अपायम् danger, उपायं वा or any way out, सम्पृष्टः asked of you, त्वम् you, एवम् in that way, वक्तुम् अर्हसि should say.
If I asked you the merits or demerits, the risks involved or the way out while deciding a case, you should have said what you did.