[API] Update create-lxc.sh / Improve error messages #1 #2049
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✍️ Description
This PR updates create-lxc.sh and reworks the error messages.
Befor it was just
error "some string"
, but this never kills the the spinner and leaves the shell in a unwanted state.I´ve updated the error messages to use
msg_error "some string"
to better handel this case.In preperation for better error messages each error gets its own designated error code, to send the correct message to the api.
✅ Prerequisites
The following steps must be completed for the pull request to be considered:
🛠️ Type of Change
Please check the relevant options:
📋 Additional Information (optional)
Before change:
![image](https://private-user-images.githubusercontent.com/73236783/409991872-5208d0d5-b88f-48fb-b182-2db9e6b0ad79.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTM3NzgsIm5iZiI6MTczODg1MzQ3OCwicGF0aCI6Ii83MzIzNjc4My80MDk5OTE4NzItNTIwOGQwZDUtYjg4Zi00OGZiLWIxODItMmRiOWU2YjBhZDc5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE0NTExOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5YjY2YjI0YTA2ZTRiYzAyOWY0NWIyMjBmZDgzM2Y4MDg0MzUwYmFhZDlmZjYwYWRiMWJjNjUwZmFhMGFlYTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Ql0wi4cuwPD_5cG55eRtysl1C97XUdOOfeHZqOWw66U)
![image](https://private-user-images.githubusercontent.com/73236783/409992689-d4d6b96a-0ce1-4daa-99fd-411516e83bbf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTM3NzgsIm5iZiI6MTczODg1MzQ3OCwicGF0aCI6Ii83MzIzNjc4My80MDk5OTI2ODktZDRkNmI5NmEtMGNlMS00ZGFhLTk5ZmQtNDExNTE2ZTgzYmJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE0NTExOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVhODZhYWU4ZmJhMTkwOTAwNDQ1Y2Y4YmY4ZDE1MWQ0NjMyOTg5NmZhYmVkODBjOGFmMGQ1NWY0NjBmYmZiNDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Jp2OzxzoQQcjOzI3duejaMgN54tVN74BnYJ6ayRwyDk)
After change: