@asgardeo/react 0.6.12 → 0.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1555,8 +1555,12 @@ var AsgardeoProvider = ({
1555
1555
  );
1556
1556
  }
1557
1557
  } catch (error) {
1558
- if (error && Object.prototype.hasOwnProperty.call(error, "code")) {
1559
- }
1558
+ throw new AsgardeoRuntimeError3(
1559
+ `Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1560
+ "asgardeo-signIn-Error",
1561
+ "react",
1562
+ "An error occurred while trying to sign in."
1563
+ );
1560
1564
  }
1561
1565
  } else {
1562
1566
  }
@@ -1717,7 +1721,12 @@ var AsgardeoProvider = ({
1717
1721
  }
1718
1722
  return response;
1719
1723
  } catch (error) {
1720
- throw new Error(`Error while signing in: ${error instanceof Error ? error.message : String(error)}`);
1724
+ throw new AsgardeoRuntimeError3(
1725
+ `Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1726
+ "asgardeo-signIn-Error",
1727
+ "react",
1728
+ "An error occurred while trying to sign in."
1729
+ );
1721
1730
  } finally {
1722
1731
  if (!isV2FlowRequest) {
1723
1732
  setIsUpdatingSession(false);
@@ -1736,7 +1745,7 @@ var AsgardeoProvider = ({
1736
1745
  return response;
1737
1746
  } catch (error) {
1738
1747
  throw new AsgardeoRuntimeError3(
1739
- `Error while signing in silently: ${error.message || error}`,
1748
+ `Error while signing in silently: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1740
1749
  "asgardeo-signInSilently-Error",
1741
1750
  "react",
1742
1751
  "An error occurred while trying to sign in silently."
@@ -1756,7 +1765,7 @@ var AsgardeoProvider = ({
1756
1765
  }
1757
1766
  } catch (error) {
1758
1767
  throw new AsgardeoRuntimeError3(
1759
- `Failed to switch organization: ${error.message || error}`,
1768
+ `Failed to switch organization: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1760
1769
  "asgardeo-switchOrganization-Error",
1761
1770
  "react",
1762
1771
  "An error occurred while switching to the specified organization."