wallet-core: more info in error message

This commit is contained in:
Florian Dold 2022-10-05 10:22:32 +02:00
parent 21fd8074cd
commit 66ae0dd220
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -730,6 +730,12 @@ export async function updateExchangeFromUrlHandler(
}; };
} }
/**
* Find a payto:// URI of the exchange that is of one
* of the given target types.
*
* Throws if no matching account was found.
*/
export async function getExchangePaytoUri( export async function getExchangePaytoUri(
ws: InternalWalletState, ws: InternalWalletState,
exchangeBaseUrl: string, exchangeBaseUrl: string,
@ -752,7 +758,11 @@ export async function getExchangePaytoUri(
return account.payto_uri; return account.payto_uri;
} }
} }
throw Error("no matching exchange account found"); throw Error(
`no matching account found at exchange ${exchangeBaseUrl} for wire types ${j2s(
supportedTargetTypes,
)}`,
);
} }
/** /**