This honestly kind of got me thinking about the depiction of torture in Star Wars. As
@Arthur Frayn noted earlier, it's basically a fringe theme of the setting. It's not like say, Star Trek TNG where there was actually a whole episode arc that addressed torture. In Star Wars, we do see it occasionally, and we know it happens in the galaxy. A viewer of the OT is probably meant to assume that the Empire regularly tortures its enemies and dissidents. But SW media is definitely anti-torture.
If you watch any media where torture is condoned as a form of interrogation, it's usually some kind of Jack Bauer-esque anti-hero. You've got a ticking time bomb, the bad guy knows where it is, but he won't talk, and so you use torture to loosen his tongue. Even though it's been proven that that's not how torture works, and that actually, any kind of "ticking time bomb" kind of situation is actually the worst because there is no way to verify whether or not the victim is telling the truth. I've never seen any kind of Star Wars media that gets into that. Only the villains are shown as using or accepting torture, and if any good/heroic character ever does it themselves, they are swiftly reprimanded and shown as being in the wrong.
The only exception I can think of, which I would really ascribe more to bad writing than to any kind of deliberate intention, is this one episode of
Clone Wars where the Jedi capture Nute Gunray. Nute, who is a notoriously cowardly and spineless official, is the kind of person who would give up
any secret to save his own skin. In other words: the kind of person who would probably get very cooperative when faced with the prospect of jail time or worse as punishment for his many crimes.
There's a scene where Gunray being interrogated by Ahsoka and Luminara Unduli where he's being uncooperative. Frustrated by his belligerent attitude, Ahsoka loses her temper and threatens Gunray with her ignited lightsaber. Luminara immediately pulls Ahsoka aside and chastises her, reminding her that threatening someone's life, even as a bluff, is not the Jedi way.
The problem with the scene is that Gunray
immediately cooperates. Ahsoka's brutal, impulsive decision pays off completely and Luminara's completely justified and valid castigation of Ahsoka falls somewhat flat as a result. Because it makes Ahsoka look like she's right and Luminara look like a preachy moraliser who doesn't understand real war.
Like, it was a single part of a half-hour episode that never got brought up again and didn't have any lasting impression on Ahsoka's character, but I definitely think it could have been handled better in retrospect.