Merge pull request #2753 from ethereum/yann300-patch-44

use the error message instead of the full error
pull/2745/head
yann300 2 years ago committed by GitHub
commit 62c897240c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/remix-ide-e2e/src/tests/publishContract.test.ts
  2. 9
      libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx

@ -3,6 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},

@ -31,12 +31,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded))
} catch (err) {
let parseError = err
try {
parseError = JSON.stringify(err)
} catch (e) {
}
modal('Swarm Publish Failed', publishMessageFailed(storage, parseError))
modal('Swarm Publish Failed', publishMessageFailed(storage, err.message))
}
} else {
if (!api.config.get('settings/ipfs-url') && !modalShown) {
@ -81,7 +76,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
const result = await publishToIPFS(contract, api)
modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded))
} catch (err) {
modal('IPFS Publish Failed', publishMessageFailed(storage, err))
modal('IPFS Publish Failed', publishMessageFailed(storage, err.message))
}
setModalShown(true)
}

Loading…
Cancel
Save