Massachusetts lawmakers are weighing a bill that would require courts prioritize treatment over penalties for people on probation who fail drug or alcohol tests.

Typically, failing a drug or alcohol test is considered a violation of probation, and a judge could incarcerate the person. Advocates say if passed, Massachusetts would be the only state that would specify that a positive test should not result in incarceration.

The bill, known as “An act relative to treatment, not imprisonment” was the subject of a legislative briefing Wednesday. A group of mental health and addiction experts and attorneys told lawmakers that the threat of incarceration impedes addiction treatment and punishes relapse, which they say is part of the disease of addiction.

“I saw hundreds of individuals placed in custody for merely relapsing, a symptom of their substance use disorder,” said Deborah Goldfarb, Director of Behavioral Health at Boston Medical Center’s Grayken Center for Addiction. “A correctional environment is not one that fosters recovery. And not only were folks not receiving appropriate treatment in custody, they are ripped away from any treatment connections they have.”