Fixed incorrect handling of the code smell for the reject API call

This commit is contained in:
Akshay Joshi
2024-06-17 18:22:38 +05:30
parent 3706c3126a
commit 2b04f3ca1d
26 changed files with 44 additions and 42 deletions
@@ -388,11 +388,11 @@ export default function SearchObjects({nodeData}) {
})
.catch((err)=>{
pgAdmin.Browser.notifier.error(parseApiError(err));
reject(new Error(err));
reject(err instanceof Error ? err : Error(gettext('Something went wrong')));
});
} catch (error) {
pgAdmin.Browser.notifier.error(parseApiError(error));
reject(new Error(error));
reject(error instanceof Error ? error : Error(gettext('Something went wrong')));
}
});
};