'How to find where error come from in snapshot.error?

I try to use StreamBuilder and I handle error by throw snapshot.error

StreamBuilder(
  stream: stream,
  builder: (context, snapshot) {
    if (snapshot.connectionState == ConnectionState.active) {
      if (snapshot.hasError) {
        throw snapshot.error!; <- This line
      }
    }
  },
);

But It tell that This line is the one making error.

Is there any way to see where actual error come from?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source