@asgardeo/react 0.6.11 → 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/cjs/index.js CHANGED
@@ -1661,8 +1661,12 @@ var AsgardeoProvider = ({
1661
1661
  );
1662
1662
  }
1663
1663
  } catch (error) {
1664
- if (error && Object.prototype.hasOwnProperty.call(error, "code")) {
1665
- }
1664
+ throw new import_browser12.AsgardeoRuntimeError(
1665
+ `Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1666
+ "asgardeo-signIn-Error",
1667
+ "react",
1668
+ "An error occurred while trying to sign in."
1669
+ );
1666
1670
  }
1667
1671
  } else {
1668
1672
  }
@@ -1823,7 +1827,12 @@ var AsgardeoProvider = ({
1823
1827
  }
1824
1828
  return response;
1825
1829
  } catch (error) {
1826
- throw new Error(`Error while signing in: ${error instanceof Error ? error.message : String(error)}`);
1830
+ throw new import_browser12.AsgardeoRuntimeError(
1831
+ `Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1832
+ "asgardeo-signIn-Error",
1833
+ "react",
1834
+ "An error occurred while trying to sign in."
1835
+ );
1827
1836
  } finally {
1828
1837
  if (!isV2FlowRequest) {
1829
1838
  setIsUpdatingSession(false);
@@ -1842,7 +1851,7 @@ var AsgardeoProvider = ({
1842
1851
  return response;
1843
1852
  } catch (error) {
1844
1853
  throw new import_browser12.AsgardeoRuntimeError(
1845
- `Error while signing in silently: ${error.message || error}`,
1854
+ `Error while signing in silently: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1846
1855
  "asgardeo-signInSilently-Error",
1847
1856
  "react",
1848
1857
  "An error occurred while trying to sign in silently."
@@ -1862,7 +1871,7 @@ var AsgardeoProvider = ({
1862
1871
  }
1863
1872
  } catch (error) {
1864
1873
  throw new import_browser12.AsgardeoRuntimeError(
1865
- `Failed to switch organization: ${error.message || error}`,
1874
+ `Failed to switch organization: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
1866
1875
  "asgardeo-switchOrganization-Error",
1867
1876
  "react",
1868
1877
  "An error occurred while switching to the specified organization."